January 29, 2005

VBScript Operators for Formula Properties

Autodesk® Architectural Desktop formula properties are evaluated as VBScript expressions. VBScript has a number of operators, falling into four categories: arithmetic, concatenation, comparison and logical. Descriptions of those that, in my opinion, are most likely to be used in a formula property can be found below. Hard core programmers who want to push the envelope of what can be done in a formula should probably acquire a reference or two on VBScript. I have found VBScript in A Nutshell, A Desktop Quick Reference, 2nd Edition, by Paul Lomax, Matt Childs & Ron Petrusha, quite useful. It has way more on VBScript than you likely need to know for writing formula properties, but the reference section contains a listing of the available commands and their use.

Arithmetic Operators
Used to manipulate numeric values.

+
Adds two numbers. Can also be used to concatenate strings, but use the concatenation operator [see below] to avoid confusion.

-
Subtracts two numbers, or indicates a negative value.

/
Divides two numbers, returning a floating point number.

*
Multiplies two numbers.

\
Divides two numbers, returning an integer – without a remainder or decimal places.

Mod
Modulo operator, divides two numbers and returns only the remainder; the original numbers are rounded to integers before performing the operation.

^
Raises a number to the power of an exponent. The number is first, followed by the “^” and then the exponent.

String Operator
Used to join individual strings into one string.

&
Concatenates two strings. Non-string values are converted to strings and then concatenated.

Comparison Operators
Used to compare two expressions, these operators return True, False or Null [only when both expressions are Null]. The first expression precedes the operator, and the second follows it. These are frequently used with If Then [ElseIf] [Else] End If statements to provide alternate formula results based on values stored in other properties [or derived from other properties].

>
Greater than, True if the first expression is greater than the second.

<> or ><

Not equal, True if the first expression is either less than or greater than the second.

>= or =>
Greater than or equal, True if the first expression is greater than or equal to the second.

<= or =<
Less than or equal, True if the first expression is less than or equal to the second.

=
Equal, True if the first expression is equal to the second.
Comparison operators work on both numeric and string values. When mixing these in a single comparison, the comparison is done in accordance with the following:

• If both the string and number are “literal” – actually written, not through a variable, then the string is converted to a number prior to comparison.
• If one is literal and the other is a variable, the variable value is converted to the type of the literal value prior to conversion.
• If both are variables, the number will be evaluated as smaller than the string.

Logical Operators
Used to evaluate one or more expressions, returning a logical value [True/False/Null]. For example, a logical operator can be used to have two conditions evaluated for a single If statement. These can also be used as bitwise operators. If you are doing this in a formula property, you really do not need to read this article.

And
Evaluates to True if both expressions are True, otherwise, False.

Or
Evaluates to False when both expressions are False, otherwise, True.

Not
Negates a single expression. If the expression is True, Not evaluates to False; if the expression is False, Not evaluates to True.

Eqv
Evaluates to True if both expressions are True or both are False; evaluates to False if one is True and the other False.

Xor
Evaluates to True if one is True and the other False; evaluates to False if both expressions have the same evaluation.

There is an order of precedence for evaluating operators when more than one appears on the same line. I so strongly recommend using parentheses to make your desired order of operation explicit that I am going to omit describing the VBScript hierarchy.

January 25, 2005

Matt Dillon on Automating Project Startup

In case you have not been following the thread in the Autodesk Architectural Desktop 2005 Discussion Group, Matt has generously shared his knowledge of automating the setup of Projects in ADT in this article in his blog.

January 23, 2005

Changing A Drawing's Plot Style Type

There are two types of plot styles: color-dependent plot styles [CTB extension] and named plot styles [STB extension]. When plotting, you will only see plot styles of the type the drawing you are plotting is set to use. If you are not seeing your plot style file, and you are certain that it is in the plot style folder [check this in the Options dialog, on the Files tab], then you likely have a file that is set to use the other type of plot style files. Verify this by opening the Properties toolbar in Autodesk® Architectural Desktop 2004 or 2005 and examining the rightmost control, for Plot Style. With no active command, if it is grayed out and displaying “ByColor”, you are in a color-dependent plot style file. If it is not grayed out and you can click on the arrow to see a list of plot styles, you are in a named plot style file.

STB to CTB: Type CONVERTPSTYLES at the Command: prompt to convert your file to use color-dependent plot styles.

CTB to STB: You will need a conversion file to map your layers [by color] to a named plot style. If your office migrated from CTBs to STBs, you may already have one of these, based on your old CTB file; if you can access that, use it and skip the CONVERTCTB step that follows. Type CONVERTCTB at the Command: prompt and select a CTB file, to create a translation file. Then type CONVERTPSTYLES and select your translation file. NOTE: This will convert the file to use STB plot styles, but will assign plot styles to layers based on their color and the corresponding named plot style in the translation file. You will likely need to reassign plot styles, based on the STB file with which you wish to plot.

How to avoid the above mess? Set up template files - or use the out-of-the-box ones - that use your desired plot style type and make certain all new files are started using one of these templates. You can also set your plot style type preference in the Options dialog [Plotting tab], but this will only cover drawings started without a template ["from scratch"], which is generally not a good idea in Autodesk® Architectural Desktop, or when opening a pre-AutoCAD 2000 file, which was before the introduction of plot styles.

January 21, 2005

User- and Project-Specific Content

Here is one way to have your firm’s standard content [AEC Content files and Style Source files] on your network, while still allowing individual users and project teams to have their own content.

Putting content files on the network is an option when you install ADT. Installation in an office environment is not something with which I have experience, so I am going to assume that you have already done that and that everyone in your office has their AEC Content path [AEC Content tab in Options] pointing to a network location, the office standard and/or out-of-the-box style/definition source files are on the network and your Tool Palette tools all point to those network files. Having those files in one place, possibly in read-only folders, makes it easy to update office standards when needed, but how do you allow users to experiment with content or accommodate project-specific needs without making everyone else wade through it all?

The answer is to use Windows shortcuts. You can “include” folders that are not directly below the root AEC Content path by placing a Windows shortcut to any folder, and then that folder, and its subfolders, will be accessible from the Content tab of DesignCenter, and AEC Content can be placed in those folders and it will be recognized as AEC Content.

At my firm, a Windows shortcut called "Local AEC Content" is placed in the AEC Content root directory and it points to the default stand-alone installation content root directory ["C:\Documents and Settings\All Users\Application Data\Autodesk\Autodesk Architectural Desktop 2004\R16.0\enu\AEC Content" in ADT2004, which is what we are using], so that each user can create her or his own AEC Content files and access them through DesignCenter. You can use any folder located on the individual computer’s hard drive, so long as the user has read/write access to it – using the default location allows multiple users on the same computer to have their own local AEC Content.

Where project-specific content needs to be available to a project team, but you would prefer not to clutter the office standard folders, you can add project-specific folders to just the members of that team by adding a Windows shortcut to the local root folder [the one to which the network shortcut added above points] on each team members computer that points to a network location associated with that project. [I am using "project" in the generic sense, not the ADT Project Navigator sense.] That project folder, and its subfolders, will be accessible from the Custom tab of DesignCenter, as will any project-specific content placed there.

Any project-specific AEC Content is then organized in subfolders under the project-specific content root folder. If there are custom tags, the source file for the Property Set Definition referenced by the tag's AEC Content file is placed in the same folder or the folder immediately above the tag file’s folder, as well. If there are project-specific styles, a folder to hold source file[s] for those styles is also located in this same network location. You can then create tools, based on these network-located files; assemble the tools onto palettes and put the palettes into a project-specific catalog, which is also located within the project's network folders. Team members can then open the project-specific catalog and i-drop the palettes into their local workspaces. Because they have already copied the Windows shortcut, any tools that reference AEC Content will work.

January 17, 2005

Printing STB and CTB Files

Autodesk provides a tool that will allow you to export the contents of a named or color-dependent plot style table to a comma delimited text file. You can look at or print this text file directly, or import it into most spreadsheet programs for additional formatting, sorting, etc. This can be quite useful when setting up an office standard or trying to compare several plot style files.

January 15, 2005

Linetype Scale

There are three system variables that contribute to the display of linetypes in AutoCAD/ADT:

1. LTSCALE is the "LineType SCALE" factor; it is applied globally to the linetype definition of all entities.
2. PSLTSCALE is the "Paper Space LineType SCALE" system variable and it controls the display of linetypes in a Layout tab. There are two choices: use 0 if you do not want the viewport magnification factor to be applied to linetypes within that viewport; use 1 if you do.
3. CELTSCALE is the "Current Entity LineType SCALE" and is the default entity line type scale applied to newly created entities. The setting of this variable only affects newly created entities; previously created entities entity scale factor is stored in their entity data and can be checked/changed in the Properties dialog. In my opinion, the variable should always be set to 1 and, unless there is an extremely good reason to do otherwise, the value should be kept at 1 for all entities. This setting has no impact on the Model tab vs. Layout tab linetype display issue, and is included only for completeness.

What settings to use for LTSCALE and PSLTSCALE will vary, depending upon how you use layouts. If all of your viewports [or if you only ever have one viewport] in your Layout tabs are the same relative scale and you never have any linetypes applied to objects in paper space, then you can set PSLTSCALE to 0 and LTSCALE to whatever you would set in the Model tab.

I rarely have that situation, so my standard way of setting up a drawing is to have PSLTSCALE set to 1. My Layout tabs are all set up to plot at full size [1:1], so when in a Layout tab, LTSCALE is set to the value I would use for full size plotting [our office standard is 0.375; other offices use 0.5 or 1.0]. On those rare occasions when I work in the Model tab, LTSCALE is set to the value based on my current "editing" scale [the intended plot scale of the area I am working on at that time]. For my office that is 0.375 times the editing scale factor, so for 1/8" = 1'-0", I would use 36. [Other offices would use 48 or 96.]

January 14, 2005

Creating A New Display Configuration For Walls

This article is based on a response I made in the Autodesk Architectural Desktop 2005 Discussion Group. It addresses the procedures for creating a new Display Configuration that will display walls differently than the way they are displayed in any of the out-of-the-box Display Configurations. The example in the tutorial starts with the out-of-the-box Medium Detail Display Configuration and creates a new one for a roof plan. This tutorial does not address the larger issue of making any customizations you make to the display system in Architectural Desktop consistent and coherent. Before diving into your office standard template and making changes, you will want to first think about the types of displays you need and how each of the various objects should display within them. You will want to come up with a plan that
• outlines your needs;
• identifies which, if any, of the existing display system components meets each need;
• identifies which new components are needed to meet any unmet needs [along with which existing component comes closest to meeting that need];
• and, finally, indicates how the existing and new components are to be combined.

Getting familiar with how the display system works is an essential precursor to being able to do the above, and one of the nice things about Architectural Desktop is that each file's display system is its own universe, so you can experiment to your heart's delight in a new file and, should worse come to worst, only lose the time you put into that file. That is a two-edged sword, as it can make updating existing files to new standards tedious. But it does allow you free rein to play around while you are learning, without fear of turning valuable files to toast. So clear thirty or so minutes in your busy schedule, start a new drawing file using your favorite template, and dive in! A sample file created as I wrote the tutorial can be downloaded from the Discussion Group post noted above. That file and this tutorial were done using Autodesk Architectural Desktop 2004. I believe it should work for the 2005 release as well. Anyone using the 3 or 3.3 release may find some things do not work as described, due to improvements made in the later releases, and you will also not be able to open the posted file.

This tutorial makes the following assumptions:

• Both viewports will use the same view direction, and that view direction will be a plan - or Top - view.
• You have an existing Display Configuration that will suit the display needs of one of the viewports. I am going to use Medium Detail, substitute the name of your Display Configuration, and the name of the Display Representation Set assigned to the Top view in your Display Configuration, if you are using a different Display Configuration.
• The display of other objects is to be the same in both viewports - only the Walls will be different. You can change the display of other objects, by repeating the process for each object type to appear differently.
• There is not already a Display Representation for walls that displays them the way you want, and there is not a Display Representation Set that displays walls and other objects the way you want them to appear in the second viewport. This is always something to check out before diving in - you can save lots of time by starting with an existing Display Representation and/or a Display Representation Set that is closest to your final goal.
• You understand the basic relationships of Display Configurations, Display Representation Sets and Display Representation Set in the ADT display system. You can find an excellent, brief description of this in the Nov/Dec 2004 AUGI World magazine, in an article by Doug Broad. You can find details on obtaining a PDF of that issue, should you not already have it, at this link.

Enough of the prattle, let's get started:

1. Set the Medium Detail Display Configuration current and look at your drawing from a Top view [while on the Model tab, or in Model Space on a Layout tab].
2. Open the Display Manager and expand the Configurations folder in the left pane. Note that the Medium Detail Display Configuration is in bold type - that is because it is the active Display Configuration [in the active viewport].
3. Select the Medium Detail Display Configuration in the left pane, and, in the right pane, note that the Plan Display Representation Set is assigned to the Top view direction. We will need a new Display Representation Set to replace the Plan Display Representation Set in our new Display Configuration.
4. Expand the left pane tree by clicking on the "+" sign to the left of "Medium Detail" [still under Configurations]. You will see a list of the Display Representation Sets used by the Medium Detail Display Configuration. Select the Plan Display Representation Set and the right pane will display a matrix - object types on the rows and Display Representation Set in the columns. For each object type, a small box appears in the column of every Display Representation that is currently available for that object type, and a check mark appears in that box for the Display Representation[s] that are currently turned on in the Plan Display Representation Set, if any. [You can see this same matrix under the Sets folder in the left pane. If you are comparing different Display Representation Sets, without regard to the Display Configurations, or creating a new Display Representation Set, you can expand the Sets folder. Since we are concerned with a specific Display Configuration, I chose to view it through the Configurations folder.]
5. In the right pane, scroll down until you can see the Wall row [second from the bottom, just above Window]. Scroll across, if necessary, examine all of the Display Representation Set that apply to Walls, and note that the Plan Display Representation is the one that is active in the Plan Display Representation Set. We will need to create a new Display Representation for walls to replace the Plan Display Representation for our new Display Configuration.
6. The Display Representation is what tells an object how to display itself. [Which Display Representation or Display Representation Set are active at any given moment are determined by which one[s] is[are] checked in the active Display Representation Set. Which Display Representation Set is active is determined by the current view direction and which Display Representation Set is assigned to that view direction in the current Display Configuration.] Right click on the checked box on the Wall row and Plan Display Representation column and choose Edit... from the context menu. The Display Properties dialog will appear, showing you the Drawing Default display settings for walls in the Plan Display Representation. Examine the settings if you like, then hit Cancel to close the dialog without making any changes.
7. So far, we have examined our "starting point" Display Configuration and identified the components we need to replace in our new Display Configuration, in a "top down" manner. Next we are going to build the new components we need, in a "bottom up" procedure. We will need to have our new Display Representation before we can add it to our new Display Representation Set, and, likewise, will need to have our new Display Representation Set before we can add it to our new Display Configuration. Begin by expanding the Representations by Object folder, scrolling down and selecting Wall, in the left pane. This will display a matrix in the right pane that lists the Display Representation Set available for Walls on the rows and the Display Representation Sets in the columns. A check mark in one of the boxes that appear at the intersection of each row and column indicates that the Display Representation listed on that row is turned on in the Display Representation Set of that column.
9. Note that there are no check marks on the Roof Plan Display Representation row - all that means is that your new Display Representation is not currently assigned to a Display Representation Set. Note also the icon to the left of your name, and that the icon includes an arrow in the upper left corner. This indicates that your new Display Representation is a custom Display Representation, and as such, can be deleted. Display Representation Set without the arrow are "predefined" and can not be deleted. Some of the out-of-the-box Display Representation Set are also custom Display Representation Set and are able to be deleted. Right click the Roof Plan name and choose Edit Drawing Default... from the context menu. Make whatever changes you need so that walls appear the way you would like them to in your new Display Configuration. On the Layer/Color/Linetype tab, I am going to turn off the display of all of the Below Cut plane component, along with all of the component Boundaries and Hatches, and change the Shrink Wrap component to color 240 [to make the change very obvious on the screen], lineweight 0.18 mm and plot style Fine. You would want to make your changes consistent with your office standards for on-screen graphics and plotting. You may also want to make changes on the other tabs; I am going to leave them as is. When you are done editing, click on OK to return to the Display Manager.
10. If you are certain that you want to keep those changes, click on the Apply button at the lower right of the Display Manager. That way, if you make a major error in the next step, you can Cancel without losing your new Display Representation. If you are really concerned about losing work, you may want to click on OK to exit the Display Manager [saving your changes] and then save the drawing file. [Clicking Apply puts the changes into the drawing file in your computer’s memory, but does not save the file to disk. If ADT and/or your computer should crash before you save the file, you would still lose the new Display Representation.] If you close the Display Manager to save the file, reopen it.
11. Expand the Sets folder in the left pane. A list of the available Display Representation Sets in the drawing will be displayed below the folder; the currently active Display Representation Set will be listed in bold type in the left pane. In the left pane, select the Display Representation Set that was used by your "starting point" Display Configuration [this should be the bold one, if you made no changes to the current Display Configuration]. This is the Plan Display Representation Set in my example. Right click on the name and choose New from the context menu. This will create a new Display Representation Set with all the same Display Representation assignments as the Display Representation Set you selected. [Should you ever want to, you can create a new Display Representation Set with no Display Representation Set assigned by selecting the Sets folder, right clicking and choosing New from the context menu.] Type in a unique name for your new Display Representation Set; I am going to call mine Roof Plan. Select the Roof Plan Display Representation Set in the left pane and select the General tab in the right pane. You can rename a Display Representation Set and change the description here. I am going to set my description to "Medium display detail for roof plan".
12. Select the Display Representation Control tab; this will show the now familiar matrix of objects and Display Representation Set. Scroll down to the Wall row and, if necessary, across to the Plan Display Representation column. Select [left click] the checked box to remove the check mark from the Plan Display Representation column, then find your new Display Representation column - mine was Roof Plan - and click on the box to add a check mark. Your new Display Representation Set will now display walls using your new Display Representation, and everything else just like the Display Representation Set you copied. Notice that the Roof Plan Display Representation column only has a check box on the Wall row. That is because we only added this Display Representation to Walls. If you also want to have other objects display in a unique manner for the same plan type, I would recommend using the same name for the Display Representation you add to those object types, both to make it easy to associate them with each other, and to prevent your drawing from having large numbers of Display Representation Set that apply to only one object type. For the purposes of our example, we are now done with the new Display Representation Set.
13. OPTIONAL: Go back the the Representations by Object folder and select Wall in the left pane. Note that there is now a new Display Representation Set column, and your new Display Representation has a check mark in that column.
14. If you are now satisfied with the changes made so far, click on Apply [or click on OK, save the file and reopen the Display Manager]. We are now in the home stretch, with just one task left in the Display Manager, and that is to create a new Display Configuration and assign our newly created Display Representation Set to its Top view direction. Expand the Configurations folder in the left pane, to display all the Display Configurations in the drawing, if it is not already expanded. Select the "starting point" Display Configuration [it should be the one in bold type], right click and choose "New" from the context menu. Rename your new Display Configuration; I am calling mine Medium Detail Roof. You can also create a new Display Configuration by selecting the Configurations folder in the left pane, right clicking and choosing New from the context menu. This will create a new Display Configuration with Plan assigned to the Top view direction and Model assigned to the Default view direction. The setting in the Default view direction is used for any view not parallel to one of the six listed above it, as well as for any of those that do not have Display Representation Set assigned. [You can create a Display Configuration that always uses the same Display Representation Set no matter what view direction is current by setting the Display Representation Set for the first six view directions to *NONE* and setting the desired Display Representation Set as the Default. The out-of-the-box Diagnostic Display Configuration is set up this way.]
15. Select the new Display Configuration in the left pane and choose the General tab in the right pane. As with Display Representation Sets, you can rename or change the description of a Display Configuration on this tab. I changed my description to "Medium scale roof plans (1/8"=1'-0")". Click on the Configuration tab and note that the Display Representation Sets assigned to each view direction match those of the one chosen when we created the new one. Change the Top view direction Display Representation Set by clicking on the name of the currently assigned Display Representation Set and choosing the new name from the Display Representationop down list - in my example, changing Plan to Roof Plan.
16. We have now created our new Display Configuration. If you wish to make it current in the active viewport, you can right click its name in the left pane, under the Configurations folder, and choose Set to Current Viewport on the context menu. If you wish to assign it to another viewport, you can do so back in the drawing. If you do set it current in the Display Manager, note that your new Display Configuration’s name is now bold in the left pane, as are any visible instances of your new Display Representation Set [assuming your current viewport is still in a Top view]. Select OK to save the changes to the drawing and close the Display Manager. Save your drawing file if you are satisfied with the changes you made.
17. Examine the effects of changing from your "starting point" Display Configuration and the new Display Configuration. In the file posted to the Discussion Group, I have set up two viewports on the Work layout tab. The one on the left uses the Medium Detail Display Configuration - my "starting point" - and the one on the right now has my new "Medium Detail Roof" Display Configuration, so you can see the differences between the way the two Display Configurations show the same wall.

January 13, 2005

Which Door Tag Should I Use?

There are three different doors tags provided in the out-of-the-box content for ADT 2004 and 2005. If you have been confused about how they work, which one to use, or how you might adapt a project-based tag for a non-project file, read on.

The "Door Tag" tag is equivalent to the one that shipped with releases prior to ADT 2004. It displays the value of the DOOROBJECTS:NUMBER property, which, out-of-the-box, is a manual, auto-incrementing integer using the Number - Object Property Data Format, so your door numbers would be 01, 02, 03, etc. You can edit the values after the fact, but the new value must be an integer. This works fine, as is, for any file [with less than 99 doors], although you may want to consider the project-based tags, depending upon your door identification needs.

The "Door Tag - Project Based" and "Door Tag - Project Based - Scale Dependent" tags are designed to work with the Drawing Management features introduced in ADT 2004 [Project Browser/Project Navigator]. Both display two properties: DOOROBJECTS:ROOMNUMBER on top and DOOROBJECTS:NUMBERSUFFIX on the bottom. The main difference between the two is that the "Scale Dependent" version inserts a Multi-View Block at a scale factor of 1, while the other uses annotation scaling. The "Scale Dependent" tag has three view blocks attached to three different Display Representations; each is scaled so that it is sized "correctly" for the out-of-the-box Low Detail, Medium Detail and High Detail Display Configurations, corresponding to the Imperial Scales of 1/16" = 1'-0", 1/8" = 1'-0" and 1/4" = 1'-0". I assume the metric tag also works in a similar fashion, for 1:200, 1:100 and 1:50, but I have not used it and can not say for certain. So if you want the same tag to display at multiple scales, the "Scale Dependent" version may suit your needs. If you often work at other scales, or only at one scale, then the non-scale-dependent version may be better.

The DOOROBJECTS:ROOMNUMBER property, in the out-of-the-box Property Set Definition, is a Location property, and it "reads" the ROOMOBJECTS:NUMBERPROJECTBASED property from the Space object found by the location grip of the door. The ROOMOBJECTS:NUMBERPROJECTBASED property is a concatenation of the space's ROOMOBJECTS:LEVEL [a Project property that reads the level assigned to the Construct in which the space resides] and ROOMOBJECTS:INCREMENT properties [a manual auto-increment integer property]. This is why these tags work only in a project environment - the LEVEL property has no useful value otherwise.

The DOOROBJECTS:NUMBERSUFFIX property is a manual text property that you fill in for each door [default value is "A"] and is used to distiguish between doors when one room has more than one door opening, since the number portion of the door identification is the room number.

If you are not using Project Navigator, but like the way the project-based tags work, fear not, you can easily modify the DoorObjects Property Set Definition to make these tags work in a non-project environment. Assuming that you are using the ROOMOBJECTS:NUMBER property for your room numbers, edit the Door Objects Property Set Definition, highlight the RoomNumber property on the Definition tab, and select the Edit Location... button at the lower left. Change the property being read from ROOMOBJECTS:NUMBERPROJECTBASED to ROOMOBJECTS:NUMBER and it will read your non-project-based room number and you can use the project-based tags.

You will need to make that change to the PropertySetDefs.dwg file located in the folder just above the tags if you want all future drawings to work that way, and use the Style Manager to copy the revised version to any existing drawings, choosing to overwrite the current version, for any files that already have the old DoorObjects Property Set Definition in them. If you are doing any additional customization to the tags and/or these Property Set Definitions, I would strongly recommend setting up a separate Property Set Definition source file with a unique name, and renaming your Property Set Defintions. This will avoid future confusion with files that have the out-of-the-box definitions in them and will also make it easier to migrate to future versions, as you will not need to remember or meticulously document all of the changes you made to the out-of-the-box content. It does mean that you will need to edit the view blocks so that their attributes reference your custom Property Set Definition and edit the AEC Content files, so that the correct source file is indicated in the Command String. Unless the only change you make is to the source for the Location property, I think it is worth the effort to set up separate files/definitions for your customizations.

January 12, 2005

"Unformatted" Properties for Formulas

Scott Arvin's Brain Dump on Property Data Enhancements discusses using unformatted properties when doing numeric calculations in a Formula Property. You may wonder how to create an unformatted property - here is what I have done, with success, when creating a Formula Property that performs a numeric calculation on the value of another property.

You make a property "unformatted" by assigning the out-of-the-box "Standard" Property Data Format [PDF], which no one has modified, right? You could also use an equivalent PDF of your own. The goal is to get numeric properties as a raw number, for example, 36.5, not 3'-0 1/2" or 36.50 SQ FT. Trying to convert formatted data to a number will likely have unpredictable results at best, and may just cause the formula to fail completely, at worst. The important settings in the out-of-the-box Standard PDF are having no Prefix or Suffix settings, Integer Zero Padding set to 0 [integer padding may not be a problem; I have never tried to use a padded integer in a formula] and real number unit format set to Decimal [Architectural and Engineering should not be used; I am not certain about the others, but would advise sticking to Decimal].

The challenge comes when you also want to reference that same property with a format, particularly for properties that you are already displaying in a tag. [Schedules have their own format settings.] There are two cases to consider: a manual property [which you do not want to have the user enter more than once] or an automatic property that is already in the PSD and has an applied format other than Standard.

For a manual property, set the PDF to Standard, set up a separate Formula Property that reads the manual property and put your desired formatting on the Formula Property. Use the formatted Formula Property in any tags you make. You can also use it in a schedule, and the PDF applied in the PSD will be the initial default PDF in the Schedule Table Style.

For a pre-existing automatic property, you need to add the same automatic property again. To do so, you need to "trick" ADT into thinking that you have not already added that property by temporarily renaming the existing one. I usually just add a single character like "x" to the end of the name. Now add the automatic property, rename the newly added property [I like to add "Unformatted" to the end of the property name, as Scott did in his examples], set its format to Standard and finally rename the original property back to its original name. I find this process easier than taking the existing property, writing down the current PDF, renaming the property [by appending "Unformatted"], resetting the PDF to Standard, creating a new automatic property of the same type and applying the original PDF format to that, but if you prefer that method, it should work just fine as well.

Now that you have your unformatted property, you are all set to use it in your Formula Property. One other piece of advice I will pass along is that, even in its unformatted state, I often find that ADT will interpret the value as a string. Depending upon exactly how you are using the reference to the numeric property, it may automatically convert that string to a numeric value. If it does not, and having the wrong data type causes your formula to fail, you can use one of the VBScript data conversion functions to get the proper data type.

For integer values, use CInt([UnformattedPropertyName]) and
for real numbers, use CDbl([UnformattedPropertyName]), where
[UnformattedPropertyName] is your unformated property, selected from the lower pane.

When creating a Formula Property to create a formatted version of a manual property as noted above, you will want to use this data conversion technique to be certain that the PDF is applied appropriately. For example, if you are manually entering a distance that you want formatted in architectural units, simply clicking on the manual property name will likely result in ADT treating the value as a string, and the architectural units specified in the PDF applied to that Formula Property will be ignored. But if you use the CDbl conversion, ADT will treat the value as a real number and will apply the architectural formatting. I have also found that when a property that is meant to be a real number hold a whole number, that ADT will treat it as if it were an integer [and not apply architectural formatting, for example] unless I use the CDbl conversion to make it a real number.

UPDATE: Users of ADT 2007 or later can avoid creating a separate unformatted property for use in formula properties, as you can assign a different Property Data Format to any property, including automatic ones, for use in a formula, in the sample values area of the formula editing dialog. More detail on this can be found in this blog article.

January 11, 2005

Matt Dillon on BIM

All you ever wanted to know about Building Information Modeling, but were afraid to ask, in a very informative article in Matt's Breaking Down the Walls blog.

Column Bubbles in the Reflected Display Configuration

A question on how to get column bubbles to display in the Reflected Display Configuration [DC] came up recently in the Discussion Groups, and I thought the procedure was worth recording here. The instructions below are predicated on the use of the default StandardGridBubble Multi-View Block [MVB] as the column bubble; if you are using another MVB or are trying to adapt these instructions to another MVB and/or DC, you will need to substitute the names of your MVB and view blocks as well as the names of your DC and the Display Representation [DR] to which you want to add a view block.

First, a brief review of MVBs. If you are an MVB expert, skip down to the next paragraph. A MVB is a collection of one or more "standard" AutoCAD blocks, each of which is assigned to one or more DRs and one or more view directions. For a given DC and view direction, there will be an active Display Representation Set [DRS] that lists what DRs are turned on for each object type. A given MVB will display the view blocks assigned to it which are assigned to both a currently turned on DR and the current view direction. For example, if the out-of-the-box Medium Detail DC is set current in a Top view, the Plan DRS is active and both the Plan and General DRs for MVBs are turned on. So any view block assigned to the Plan and/or General DR that also has the Top view direction checked will be displayed. If a particular MVB Definition has no view blocks assigned to either the Plan or General DRs -OR- if the blocks assigned to those DRs are not set to display from the Top view direction, MVBs of that type will not be seen.

Architectural Desktop will generate the StandardGridBubble MVB if it does not already exist in the drawing and you do not specify another MVB when you first label a column grid in a drawing. The MVB Definition generated does not have a view block assigned to the Reflected DR. To add one, so that the bubble will be displayed when the Reflected DC is current, either edit the StandardGridBubble MVB definition through the Style Manager, or set a DC current in which the bubbles display [such as Standard or Medium Detail], select one of the bubbles, right click and select "Edit Multi-View Block Definition..." from the context menu.

On the View Blocks tab of the Multi-View Block Properties dialog, note that the General and Model DRs have the BubbleDef view block assigned, but not the others. Select the Reflected DR in the left edit box, then select the Add... button. Pick the BubbleDef block from the list box and click on OK. With the Bubble Def block still highlighted for the Reflected DR, uncheck the Front, Back, Left and Right view directions, if you like, to match the setup for the General DR.

Select OK to save the changes to the StandardGridBubble MVB and then change your DC to Reflected. You should be able to see the grid bubbles and your ceiling grids simultaneously.

Because the StandardGridBubble MVB will be generated automatically if it does not already exist in a drawing file, you should copy the revised StandardGridBubble MVB definition to all of your template files if you want to have the bubbles display in the Reflected DC in all your drawings.

January 10, 2005

Styles and Other ADT Content

You can find sample content files created by fellow users on the United States Autodesk website in the Data & Downloads-Styles area of the Autodesk Architectural Desktop section. There are quite a few item there, including contributions by names familiar to anyone who participates in the ADT Discussion Groups.

Speaking of which, you can also find content on the Discussion Groups, too. Some posts in the release-specific groups include example files illustrating a problem and return posts indicating a solution. There is also a Discussion Group dedicated to posting completed sample content files for sharing with others, the Autodesk Architectural Desktop Content Discussion Group.

Even if you can not use these content files directly, they may inspire you to create your own content and help you create it. The next time you need to create content of your own, search these two locations to see if someone has posted something you can use or adapt.

AUGI ATP Courses for January 2005

Session 1 of the January AUGI ATP classes has begun. The following courses are being offered this month:

• Ferramentas que otimizam o trabalho no Autodad. - Luciana Klein

• Focused VBA: Lesson 1 - Intro to VBA. Beginning Concepts and the Development Environment. - Ed Jobe

• Rev It Up With Revit! - Beth Garrison

If one of these interests you, login to AUGI's website, click on the Education link, then choose Current ATP Courses in the left pane. If you are not an AUGI member, you can become one by clicking here.

January 07, 2005

Updating Multi-View Blocks

“The only constant is change.” Even in the most carefully developed office or personal standard, eventually there will come a time when an established standard has to be modified. If a Multi-View Block definition – including one for a tag - is changed, you can update existing drawings that have already made use of the “old” definition. The process may not be intuitive, so I am outlining the steps here.

If you have created DesignCenter content files or a Tool Palette tool to insert your Multi-View Block, be aware that using either of those sources will not overwrite an existing definition in the target file – the local definition in the target file will be used, not the revised definition in the source file. Using the Style Manager to update a Multi-View Block definition between two files will update the definition and will copy in any view block definitions that do not exist in the target file, but will not redefine any view blocks if a block definition of the same name already exists in the target file.

In order to update changes to a view block, here is what you have to do. In the following instructions, I am assuming that there is a tag content file called DoorTag, which makes use of a Multi-View Block named Door_Tag, and that it contains a view block called Door_Tag_P. The DoorTag content file has been edited to change the Door_Tag_P view block to the new office standard. The new standard is to be used on a project which was already underway, so the changes need to be brought into a file named FloorPlan, which already has at least one instance of the Door_Tag Multi-View Block, using the previous definition. Substitute the name of your source file, Multi-View Block, view block and target file for those noted above.

Step 1
Open the DoorTag file and WBLOCK the Door_Tag_P view block definition out to a separate file [Door_Tag_P.dwg] by choosing the “Block” radio button in the Source area of the Write Block dialog and then selecting the Door_Tag_P block from the drop down list. Close the DoorTag file.

Step 2
Open FloorPlan.dwg and use the INSERT command to insert the WBLOCKed view block file by selecting the Browse… button in the View dialog and navigating to the folder to which you WBLOCKed the view block. Select the Door_Tag_P.dwg file and select the Open button. In the INSERT dialog, note that the Name edit box reads Door_Tag_P and that the folder path appears below the edit box. Select OK, and, when prompted, select Yes to indicate that you want to redefine the Door_Tag_P block. If you indicated that you wished to specify the insertion point, scale and/or rotation on-screen in the INSERT dialog, you can hit the ESC key at this point, otherwise, find the insertion of Door_Tag_P and erase it. You have now redefined the view block in FloorPlan.dwg.

Step 3
At this point, if all of the view block revisions were to graphics other than attributes, you should be seeing the changes in all existing instances of the Door_Tag Multi-View Block. If not, a REGEN, REGENALL or OBJRELUPDATE [selecting All or all of the Door_Tag Multi-View Blocks] should update the display and you are done. If you made changes to attributes, please proceed to the next step.

Step 4 [2004 & 2005]
This step will vary depending upon the version you are using. For users of Autodesk Architectural Desktop 2004 and 2005, life is good. Type MVBLOCK at the Command: prompt and press ENTER. Then activate the Update option by typing U and pressing ENTER. Select all of the Door_Tag Multi-View Blocks, press ENTER, and respond to the prompt concerning the updating of attribute text style and effects by typing Y and pressing ENTER. The existing instances of the Door_Tag Multi-View Block will update, and any added in the future will use the new view block definition.

Step 4 [3.3]
If you are using Autodesk Architectural Desktop 3.3, things are a little different. If you are using Release 3 or earlier, you can try the following, but as I never used 3 and no longer have access to 2, I can not be certain it will work. As Style Manager did not exist in Release 2, you will need to adjust the editing instructions to suit.

If you had made a "substantive" change to the view block attribute[s], like renaming the attribute tag value, or adding a new attribute definition, the Update option of the MVBLOCK command, as noted in Step 4 [2004 & 2005] above, should work. But a "minor" change, like changing the text height or text style of an attribute will not be affected by this command.

To force the change, open the Style Manager to Multi-View Block definitions [from the pulldown menus, Desktop>Multi-View Blocks>Multi-View Block Definitions...]. Find the Door_Tag Multi-View Block, and double click on its name [or right click and choose Edit... from the context menu]. On the View Blocks tab, carefully note the view block[s] and the view direction[s] assigned to each Display Representation. [I suggest writing it down - your memory may be better than mine.] The redefined Door_Tag_P view block should be listed at least once, possible more than once, depending on the tag. AFTER RECORDING THE CURRENT SETTINGS AS NOTED ABOVE, select every instance of the Door_Tag view block and use the Remove button to remove it. Hit the OK button. In the Style Manager dialog, click on the Apply button [NOT OK]. This ratifies the change you just made to the drawing file [and your DoorTag Multi-View Blocks will all "disappear", if your Display Configuration was set to show the Door_Tag_P view block].

Re-edit the Multi-View Block definition, and, on the View Blocks tab, use the Add button to add the Door_Tag view block back to all of the Display Representations where it existed before, and check only the view directions that were checked for that Display Representation before.

Select OK twice to get back to the drawing, and you should see the existing instances of the DoorTag Multi-View Block now have the revised attributes.

January 04, 2005

Overview of the Display System

Whenever a question comes up about the Display System in Autodesk Archtitectural Desktop, I always have a hard time with the competing goals of brevity [go on too long, and your audience will drop to zero] and thoroughness [leave out too much and you not only fail to answer the question, you breed confusion and mistrust and generate even more questions].

In the Nov/Dec 2004 issue of AUGI World, Doug Broad has written an article, Wall Styles and Display Reps, that includes one of the best, succinct overviews of the Display System that I have read. If you do not have that issue handy, you can download either a high resolution or low resolution PDF version of the issue by clicking on the links.

You can also get your own subscription to AUGI World, issued bimonthly, by becoming a member of AUGI. Membership is free and gives you access to all of the services AUGI offers the CAD community.

January 03, 2005

Reference Sources for Architectural Desktop

I find myself providing these links in the Autodesk Architectural Desktop Discussion Groups on a regular basis, and thought I would post them here for easy reference. Take note of the ADT version associated with each item. Many of the older items are still quite relevant - some directly, others conceptually - but obviously they would not include information on features added to releases after they were written.

The Brain Dumps
Chris Yanchar started collecting these back when he was a "civilian" and posted them to his website. The collection has now moved to his blog, where he notes the version of ADT current when each Brain Dump was written. His blog is also an excellent source for news and information related to ADT.

Architectural Desktop 1 Brain Dumps
Philosophical Brain Dump on ADT, James Awe
Wall Information & Examples, Chad Ames
The ADT Display System, James Awe
Section Information & Examples, Chad Ames
Layering & DisplayProps, James Awe
Mass Elements, Marc Schindewolf
Basic Object-Oriented Design as A Means to Understanding ADT, James Awe

Architectural Desktop 2 Brain Dumps
The ADT User Interface, James Awe
Philosophy of ADT, Part 2, James Awe
Wall Cleanup Information, Chad Ames
Display Control Revealed, Matt Dillon
Layer Standards, Key Styles, and Overrides, De-Mystified, Matt Dillon
Schedule Basics, Matt Dillon
Creating Custom Automatic Schedule Tags, Matt Dillon

Architectural Desktop 3 Brain Dumps
MTEXT Formatting Codes in Schedule Tags & Multi-View Blocks, Scott Arvin
Areas, Siggi Pfundt

Architectural Desktop 2004 Brain Dumps
The ADT 2004 User Interface, Mark Webb
Tools and Content Browser, Mark Webb
Property Data Enhancements, Scott Arvin
Drawing Management, Paul McArdle
Tool Catalogs for CADConnoisseurs, David Driver

An Additional 2004 Source
ADT AutoLISP Functions for Layers, Mark Webb [last post in thread]
Note: For ADT 2005, the ARX file is AecLMgrLISP45.arx