Thursday, January 25, 2007

ADT Window Style Type in a PSD

I noticed a question on the Architectural Desktop discussion group and wanted to share the solution here. The Window Type for a windows style is not available as an automatic property. So a bit of VBScript is needed.

Create a PSD (Property Set Definition) that applies to Windows styles and add the automatic property Handle. Then add the formula below in the Formula Property Definition. Notice that [Handle] in the formula must be selected from the "Insert Property Definitions" list.

In the code AecX.AecArchBaseApplication.5.0 refers to ADT 2007.

For other versions of ADT change it.

ADT 2004 - AecX.AecArchBaseApplication.4
ADT 2005 - AecX.AecArchBaseApplication.4.5
ADT 2006 - AecX.AecArchBaseApplication.4.7
ADT 2007 - AecX.AecArchBaseApplication.5.0
ACA 2008 - AecX.AecArchBaseApplication.5.5

On Error Resume Next Set app = GetObject(, "AutoCAD.Application") Set AecArchBaseApplication = app.GetInterfaceObject("AecX.AecArchBaseApplication.5.0") Set doc = AecArchBaseApplication.ActiveDocument Set WindowStyles = doc.WindowStyles Set WindowObject = doc.HandleToObject("[Handle]") Set WindowStyle = WindowStyles.Item(WindowObject.StyleName) Select Case WindowStyle.Type Case 0 RESULT = "Custom" Case 1 RESULT = "Picture" Case 2 RESULT = "Single Hung" Case 3 RESULT = "Double Hung" Case 4 RESULT = "Awning - Transom" Case 5 RESULT = "Double Casement" Case 6 RESULT = "Glider" Case 7 RESULT = "Hopper - Transom" Case 8 RESULT = "Pass Through" Case 9 RESULT = "Single Casement" Case 10 RESULT = "Single Hopper" Case 11 RESULT = "Single Awning" Case 12 RESULT = "Vertical Pivot" Case 13 RESULT = "Horizontal Pivot" Case 14 RESULT = "Uneven Single Hung" Case 15 RESULT = "Uneven Double Hung" End Select


Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner