Friday, July 2, 2010

I've been playing around with a variable openings for doors in plan view and never quite worked it out. So I finally sat down and started from scratch to get this settled.

And since this is not only nice to have but also interesting to do (from an academic point of view :) ), I thought I'd share. So here goes.

I first started with a Generic Model - line based.


I then create a Reference Line, to which I will attach my opening door. Just put it at any angle but be sure to start it from the family origin.

Adding an Angular Dimension with a Label will make this puppy move like I want it. But since I want to be clever, I use an "internal" Label for this, calling it aopen and sorting it under "Other". Why? Well, I'll tell you in a second.


First will quickly draw a "door" with a variable thickness (after all, you could also use this family for windows...). I'll use Symbolic Lines to draw a rectangle, attaching one side to the movable Reference Line and adding some labeled Dimensions to it.

OK, so now for the "smart" part. I want this door to display a possible opening of 10 to 170 degrees, and turn off when the opening angle is below 10.

So I create two new parameters, called opening angle (angle) and door visible (yes/no). The first is so the user can change the angle and the second will turn it off automatically. I the program them as following:

aopen = if(opening angle < 10°, 10°, if(opening angle> 170°, 170°, opening angle))

and

door visible = not(opening angle<10)

Now I just set the Visibility of the door-lines to the door visible parameter and I am done.

Now, when the user enters a value lower than 10 the actual aopen-angle will stay at 10, preventing the family to break, but turning off the visibility. And an automatic doorstopper is set at 170 degrees.

Of course you could also introduce variables to set the minimum and maximum opening angels etc, but hey. That's up to you. :)

3 Comments:

  1. Anonymous said...
    I have made many door families in the past and I am trying to understand why you would start your door with line-based family template.
    If you use this line-based family for nesting, somehow they have a tendency to break inside the host, as I have experienced this with other families with this technique.

    Philip Chan
    Oliver said...
    Hi Philip,

    Thanks for the tip. I have not pursued this further yet, as I have been busy with other things. I was indeed planning on nesting this into the actual door family.

    What would your way of doing this be?
    Anonymous said...
    I have done it two different ways in the past. One of the options is to do the 2D door swing as a detail component and nest it in the door host family, or you can make this 2D symbolic door swing as a generic family then nest it in the host. Either way will work fine and should flex accordingly. Line based template is best used it as a host family other than a nested component.
    At least that's my opinion.

    Philip
    pchan925(at)yahoo(dot)com

Post a Comment