Saturday, April 08, 2006

Multi Line Schedule Tag in ADT 2007

Quite often while consulting on projects, my clients ask for the ability to enter text that appears on two lines as the part of an ADT tag, and at the same time shows as one line in their schedule tables.
My reaction for the most part was to refer them to a few posts on ADT discussion groups that give an excellent description for the approach where the user has to manually enter both lines as the part of the tag. What follows is a relatively straightforward string concatenation for the third property definition that will be referenced by the schedule table.
Needless to say, there is nothing wrong with this technique, but like any other problem, this one can be solved by an alternative approach.
Another issue that is relatively common, especially for architectural offices that are engaged in elaborate planning activities, is whether to use a manually declared room name from the RoomObjects PSD or to create a set of space styles and use the SpaceStyle name as a source for the tag value.
So, I decided to embark on creating a multipurpose Room Tag that, instead of concatenating strings, breaks them down into two rows and allows the user to decide how to split them for each instance.
Little bit of reverse engineering, a little bit of new List Definitions, (thank you o’ good people of Manchester), little bit of luck and some strong coffee and a drop of mélange and the new Tagging abomination has finally become One with the inner workings of ADT.

Here are the ingredients;
· One healthy ADT room tag project based
· Two new List Definitions (NameType and WordSplit)
· One new PSD named _ARBA_RoomObjects
· NAME_01, Formula Property Definition
· NAME_02, Formula Property Definition
· FormulaName, Formula Property Definition
· RoomName, Formula Property Definition

When thinking about the best approach to this problem, two parameters are essential for it to function properly. One that deals with the Style type and is used for storing a description for a given space, and a second one that will be in charge of determining after how many words a name string will be divided into two.
And, this brings us to the more enjoyable part connected to the ADT 2007 release.
The List Definition is the new and long awaited data container that allows one to group values into a list. That list than becomes available through the combo box on the properties palette.

For this exercise, I have created the two new lists; NameType and WordSplit. Values that pertain to NameType are ByRoom and ByStyle, and values that are predetermined for WordSplit are Integers from 1 to 9.

Here is the next step, 20 minutes to go, and in no time we will place those previously mentioned ingredients into the hot VBS wok.

From the DOCUMENT-> Scheduling -> Property Set Definitions (AecPropertySetDefine), launch the PSD dialog box and if there is an existing RoomObjects property set, highlight it and copy and paste it under a new name. In this case I have created the new property set under name _ARBA_RoomObjects, that applies to Space Objects. Feel free to name it any way you like as long as you refer to this property within the newly created AEC object tag. If you look back at the ingredients list, you will notice all of Property Definition based ones, are contained within this _ARBA_RoomObjects Definition Set.

I really had no idea or programming knowledge to know how to embed the mtext object and have it preserve its multiline quality when being converted into an attribute, so to cook this up we had to use locally grown ingredients;
The formula property definition that has been somewhat optimized to the best of my ability to parse an input string and look for spaces between words. As long as there are spaces between words and the Count variable is less than the value that is passed from WordSplit, the room name is truncated and concatenated one word at the time. Finally, RESULT determines the current value for this formula based property definition. Feel free to take this code and season it to your taste.

The RESULT generated in FormulaName property is processed by the Name_01 property that compares this RESULT to the actual Room or Space style name. Based on this comparison the first line in the room tag will be populated or left empty.

Finally to make this story short, the Name_02 property will subtract, actually replace the original content of Name_01 within the RoomName by an empty string.

Do not forget that the RoomName property definition is determined by selecting one of the two values in the NameType list, ByRoom or ByStyle .

The Case Select statement will, based the on chosen value, generate the current name for processing within FormulaName definition.
The very last piece of this recipe is creating the room tag with two line entries for the truncated room or space name. So go ahead and create a block with the following attribute content, or you can use the AEC tag wizard with two separate text lines for a new tag definition.

What I did was to modify and existing AEC OOTB Room Tag by changing the pre colon part of the attribute and matching it to the new Property Set Definition named _ARBA_RoomObjects.
After all the cooking is done, lay back, invite your family and friends, and serve this dish slightly chilled in a space or a room of your choice.
To illustrate the effectiveness of this spiced up tag, here are some examples and the sample file that is available for download from the following location.

Sample File