June 16, 2008

Text Case and the Quantity Column

A recent thread in the Autodesk AutoCAD® Architectural Discussion Group called my attention to the fact that, like the way real numbers are evaluated when including a quantity column in a Schedule Table, text strings are also evaluated using the "raw," or input value, and not the value that results from applying the Property Data Format assigned to the property (or to the property's column in the Schedule Table Style).

So, for example, even though the Schedule Table displays your text value in all capital letters, if the data is entered in different mixes of upper and lower case letters, only those objects whose data were entered identically will be collapsed into one line. In the example files I posted to the thread noted above, I created a manual, text-type property in an object-based property set, and applied the out-of-the-box Case - Upper Property Data Format. I entered the characters, but all upper case for some and all lower case for others. I kept the Case - Upper formatting on the column in my Schedule Table Style, and even though the data appears identical in the Schedule Table, the values entered in upper case collapsed into one line and those entered in lower case collapsed into another.

Fortunately, the workarounds similar to those suggested for real numbers will also work for text values that you can not guarantee will be uniform. If you can not use a List to assure that all values are entered identically, and you have a Property Data Format that formats the text the way you want, simply set up a formula property and pass through the formatted manual property enclosed in double quotation marks. For a manual property called WindowType, the formula would look like this:
"[WindowType]"
where [WindowType] is a property reference selected from the pane below the formula editing pane.

If you need to force all upper case or all lower case text, and do not want to create or rely on a Property Data Format, then you could use the UCase or LCase VBScript functions to achieve that result, respectively:
UCase ("[WindowType]")
While you might be able to replicate sentence case or title case with a more complicated VBScript statement, I would recommend creating a Property Data Format that applies the desired format to the manual property and then pass through the value in quotation marks for either of these formats.

Keep in mind that in later releases, you can choose to not display the formula property in the Properties palette or in the Edit Property Data dialog. The user can not edit the value anyway, and omitting it here will reduce clutter as well as eliminate inquiries as to why there are two properties with what appears to be the same value. Just remember to use the formula property in your Schedule Table Style, not the manual one.

No comments: