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




11 comments:

Anonymous said...

Okay, after 3 hours, I still can't get this set up (not even to the point of trying to test it. I think you need to expand the steps - to step by step for novice people. It's very frustrating. I don't have any Room Objects or at least I cannot find them in my ADT package. So I tried to start from scratch like you said you did. There is no 'style' in my space objects. What is the formula for Numberprojectbased? It would be helpful if your columns were widened so that the contents could be legible for those of us who don't how to do all this customization.
I'm still having troubles with the fact that we're on version 2007 and this isn't even in the base ADT package - I've always used 2-line name tags in my projects! Also, it would be nice if they had an easier way of demo vs. new vs. existing construction. It's all very clunky right now...

Tomislav Zigo said...

Tom,

Did you download the sample file?
NumberProjectBased is part of the OOTB RoomObjects PSD, and it is a concatenation of "[Level]" and "[Increment]" properties.
If you click on any of the posted images they should open in a separate window at their original size.

BethPowell said...

A very helpful tutorial.

To expand on this, it would be nice to see you take this to the next level by creating a door tag for those rooms that would add a letter to the room number for rooms with multiple doors.

Keep up the good work.

Anonymous said...

Excellent job.
It's much more powerful than the way I had to accomplish this prior to the introduction of list types.

Anonymous said...

Does this work in ADT 2006 as well?
The sample you posted is 2007, could you add a 2006 version as well if possible, thanks

Tomislav Zigo said...

The 2006 version is available now as well.

Mike Deitz said...

Tomislav,

You mentioned to Leo the Builder that a 2006 version of this is available.

Where would I be able to find this?

Thanks in advance,

Mike

Tomislav Zigo said...

The file links were disabled due to some maintenance issues. You should be able to access all of the sample files, and hopefully I will be posting some new content in next few weeks.

Anonymous said...

What happens if you use a quote character (34) in your room name. Doesn't that crash the VBscript formula???

Tomislav Zigo said...

Yes, it seems like a bug, and indeed when I tried to implement
REPLACE ( "[RoomName]" , Chr(34) , "’’"), it did nothing. So in this instance the best solution would be to use the double apostrophe ‘’ as a substitute for the quotation mark.

Anonymous said...

Rick Kremer-Florida
Thank you for posting your file. This works great!!!!! Also much better than the way I've done the two-line room tag in prev. ADT versions.

AUTODESK if your reading this you should incorporate this into ADT 08 or whatever its called now. Plus pay the guy who created this.

Rick