You can find the sample file that generated the images below in this thread in the Autodesk Architectural Desktop Discussion Group. The sample file contains a Door Style for each of the twenty Door Types that exist in ADT 2004, an instance of each Door Style and a custom Property Set Definition called "DoorStyles4".
The Door Styles were made by copying the Standard door style, attaching the DoorStyles4 Property Set Definition, and setting the Door Type. All other settings remain as per the Standard door style. The DoorStyles4 Property Set Definition has one Automatic property, "Handle", that uses the Handle Automatic Property Source. This allows the other two properties to access the data for each door in the drawing. Those two properties are Formula properties, called "DoorTypeNumber" and "DoorTypeText" and are independent of each other. "DoorTypeNumber" returns the quoted string stored in the Type property of the Door Style of the door. "DoorTypeText" takes that same value and uses a Select Case statement to return the "name" of the Door Type, as shown in the list box on the Design Rules tab.
The "DoorTypeNumber" formula looks something like this:
Set acadApp = GetObject(,"AutoCAD.Application")
Set doorObj = acadApp.ActiveDocument.HandleToObject( "[Handle]" )
Set doorStyle = doorObj.Style
doorTypeInt = doorStyle.Type
RESULT = doorTypeInt
The "DoorTypeText" formula starts out the same, but adds a Select Case statement to return the appropriate text string:
Set acadApp = GetObject(,"AutoCAD.Application")
Set doorObj = acadApp.ActiveDocument.HandleToObject( "[Handle]" )
Set doorStyle = doorObj.Style
doorTypeInt = doorStyle.Type
Select Case doorTypeInt
Case "0"
RESULT = "Custom"
Case "1"
RESULT = "Single"
Case "2"
RESULT = "Double"
Case "3"
RESULT = "Single-Dhung"
Case "4"
RESULT = "Double-Dhung"
Case "5"
RESULT = "Double Opposing"
Case "6"
RESULT = "Uneven"
Case "7"
RESULT = "Uneven-Dhung"
Case "8"
RESULT = "Uneven Opposing"
Case "9"
RESULT = "Bifold"
Case "10"
RESULT = "Bifold Double"
Case "11"
RESULT = "Pocket"
Case "12"
RESULT = "Double Pocket"
Case "13"
RESULT = "Sliding Double"
Case "14"
RESULT = "Sliding Triple"
Case "15"
RESULT = "Overhead"
Case "16"
RESULT = "Revolving"
Case "17"
RESULT = "Pass Thru"
Case "18"
RESULT = "Accordion"
Case "19"
RESULT = "Panel"
Case "20"
RESULT = "Communicating"
Case Else
RESULT = "Unknown Door Type"
End Select
The image below shows the Schedule Table in the sample file that displays the results of the formulas. I tagged each door with the ADT 2004 out-of-the-box, non-project door tag, and set the door numbers equal to the number corresponding to the Door Type.
5/23/2006 Update: Using ADT 2006 or later and need to have this formula work across external references? Have a look at this article.
No comments:
Post a Comment