I would like to add a automatic property set definition for door "swingdirection" in my door schedule and replace the “left” with LH, “right” with RH and if neither (N/A) with DBL (for double leaf doors).
I thought I remembered being able to view source code in 2004 ADA to give me an idea on how to change and replace but I’m lost in 2013.
Solved! Go to Solution.
The doorswing property is already defined in OOTB content.
You will need a formula property to convert the doorswing property result from LEFT and Right to L/H and R/H respectively. I don't know enough about If and Then statements, maybe someone else will join in this post to point you in the right direction.
I would suggest using a Select Case statement, given the multiple choices (although nested If statements could also work). Assuming that an automatic property using the Swing Direction automatic property source for Doors has been created, and called SwingDirection, the following will do what you asked:
Select Case "[SwingDirection]" Case "Left" RESULT = "LH" Case "Right" RESULT = "RH" Case "NA" RESULT = "DBL" Case Else RESULT = "**UNEXPECTED RESULT**" End Select
[SwingDirection] has be be a properly created property reference, selected from the lower left pane of the formula editing dialog, and not simply typed (or cut and pasted). You will want to enclose it in double quotes.
A few thoughts:
1. ACA has no automatic way (of which I know), to determine whether a door swings into or out of the "inside" space being served, so there is no automatic way to get it to report left hand reverse (LHR) or right hand reverse (RHR). The formula above will report LH for RHR and RH for LHR. You could add a manual property to flag reverse doors, and test for that as well.
2. The SwingDirection property will report NA for more than just double doors. The Pass Through (used for Cased Openings), Overhead and Revolving Door Types (and, perhaps others, I did not test all types) also report NA, but would not be considered double doors. The formula above could be made more complex, to test for the Door Type, and report something different for non-double doors without a SwingDirection.
Hi David and thanks, Its been a long time since I've made any custom properties, would there be any chance you could attach or send me a dwg with this working so i can look into exactly how its done.
I tried it a few times and can not get it to work.
if not its no big deal.
The attached ZIP file has a drawing file, done in ACA 2010, that has a working version of the formula property previously posted. Look in the DoorObjects2 Property Set Definition, for the DoorSwing property.
Curious, what is the difference between a "case" clause and a "else if" clause?
i usually use else if... else type of clauses in coding.
is this bad?
im pretty newb, but know enough to get dirty and get stuff done. thanks for the input as always!
Nothing wrong with either approach. Which is better for a given situation depends on the situation and on the programmer's preferences. If there are only two or three test values, if you need to do a comparison other than "equals", or if you want to test a different variable if the first test fails (ElseIf), then and If Then Else statement can be appropriate. Select Case statements shine when you are testing the value of just one variable, especially if there are many possible values, and the comparison is "equals". You can do the same with nested If Then Else statements, but the code can become much harder to read.
It is actually possible to use comparisons other than equals in a Select Case statement, provided that you make the thing to which you are comparing "true" (vbTrue). You can find an example of that near the end of this blog post, which covers the Select Case statement in more detail.
For more detail on the If Then Else statment, you may want to look at this blog post:
Microsoft also has a website (http://msdn.microsoft.com) that provides explanations of various VBScript commands. You can access that while editing a formula property by finding the command for which you want more information in the lower right pane, right clicking on the command, and choosing VbScript Help: from the context menu.