Showing posts with label constraints. Show all posts
Showing posts with label constraints. Show all posts

Tuesday, November 27, 2012

Rounding Length Values

When you create formulas in the Family Editor or perhaps in a schedule you can use the relatively new Round, Roundup and Rounddown options. They are designed to be used for unitless values. How often do we use unitless values? Click if you want to read the info at Autodesk's WikiHelp.

The other night I wanted to divide a panel height but round off the result. Take a door panel that has 6 lites that are defined by equal height from the top of the panel for example. One approach would be to just make the spacing equal. In this case the last lite is where the "slop" is supposed to go by making the upper lites equal in size. This means that the last lite is a little different size but then the bottom rail can be changed regardless of the lite sizes, without altering them.

The formula ended up looking like this:


In plain English, I add the top and bottom rail height together, subtract that from the panel height, divide by the number of lites. The rounding is applied to that result and divided by the desired rounding unit (1") and finally to satisfy Revit's quirkiness multiply the result by 1" to redefine what the units are. A bit round about (pun intended) but got where I wanted to go in the end.

Quick tip: When you add a parameter, click Apply before trying to fill in a formula. Revit needs to "save" the parameter before you can start using a formula in it. You'll typically get a message: "Can't find solution for formulas for type", wrote about this back in 2009.

Thursday, November 8, 2012

Two Minutes with Constraint Quirkiness

Okay it's a little more than two minutes but less than three. I've been running into a few things lately that I don't recall being an issue in the past. Then again maybe my memory isn't what I thought it was? Take a look at this image. Seems pretty straightforward.


I've got a pair of Reference Planes that I want to keep positioned on either side of a rail (as in stiles and rails for a door). In the past I could do what you see and then use the dimensions on the right to shift the collection of reference planes up or down a bit. Now I find that I can't unless I select all three together. In the past I just grab the one in the middle and use the referencing dimension to shift it up/down. Doing that now gives me some weird results. It's probably better and easier to explain it with a video so here's one at You Tube.


Thursday, September 27, 2012

Family Types Dialog - Lock Parameter

This concept showed up a couple releases ago if I recall correctly. I'm referring to this bugger:


The help file says:
    "You can maintain the parametric relationships between labeled dimensions by locking them. To lock a dimension directly in the drawing area, click next to the dimension."
    "When a labeled dimension is locked, all of the associated parameters also lock. This means that as the dimensions are moved in the drawing area, the associated parameters are constrained and the dimension value is preserved."
    "Note: Locked dimensions and their associated parameters cannot be changed in the drawing area. Use the Lock column in the Family Types dialog to change them."
    "When a labeled dimension is unlocked, all of the referenced geometry unlocks and is unconstrained."
    "To lock a labeled dimension from the Family Types dialog
    • Click a dimension in the drawing area.
    • Click Modify | Dimensions tab | Properties panel Family Types.
    • Select Lock to constrain a parameter."
I find that this part isn't true:
    "Note: Locked dimensions and their associated parameters cannot be changed in the drawing area. Use the Lock column in the Family Types dialog to change them."
When I select a dimension string that has been locked I CAN change the value and flex the geometry. What I CAN'T do is drag a reference plane to alter the parameter value "in Canvas". The text is misleading. It sure sounds like I can't alter the parameter at all, except by opening the Family Types dialog.

Another thing that is a bit confusing. In the project environment we can't change the position of elements by selecting a dimension string first and then editing the value. We CAN do that in the family editor. Inconsistent user "feedback" when transitioning to and from. In the project we keep stressing that we must select the element and then edit the dimensions. Exactly the opposite when a parameter is attached to the dimension in the family editor. Uh oh, I just saw a student's head explode...sorry.

    Saturday, August 18, 2012

    Constraining Tangents

    I read a post at AUGI the other day which originated with a post in July (2012). The goal was to create a rebar shape for detailing purposes. A few people offered ideas even a file or two. It seemed simple enough to do but digging into it I found several variations in a theme to constrain the geometry works. Here's my exploration captured in these images.

    This image is the overview of what parameters are desired: Length, Depth, Fillet Radius and Angle.


    Simply sketching the "bones, muscle and skin" is often enough. In this situation, as you flex the parameters the tangent arc starts to distort eventually. Revit does not understand how to respect the arc and line end points, keeping the lines tangent to the arc. That means it needs more constraints. One way to see how well Revit understands our intentions is to turn on Automatic Sketch Dimensions (ASD's).


    When you see little blue dimensions you know that Revit doesn't understand you, you need to be more explicit. If you look closely at the very last image you'll a single ASD (showing 0'-0") along the vertical reference plane. Unfortunately just getting rid of ASD's with better constraints isn't a guarantee for success.

    This image is the messiest solution, I used a circle to "see" how the geometry moved around and then used it to create enough constraints so that it flexes correctly.


    This image is a variation on the previous theme but using Reference Lines as the underlying "bones", pretty "messy" too eh?


    This is yet another approach. I used a pair of model lines (assigned to Invisible) to govern the location of the arc and line endpoints.


    This final one is the simplest in appearance but it has two line segments instead of one along the angled segment. I noticed that connecting the end of the angled line would break the relationships. I tried pulling the end of the line away from the end of the arc, leaving them apart, and flexing geometry worked. That led me to try a second line between the end of the arc and the end of a smaller line and it worked too. Not obvious at all. It also means that the family will break if one of these segments is flex too far, assuming the changes result in a zero length segment. The family will break easily anytime the angle entered creates a zero length segment of the vertical line too (all of them, not just this one). Fragile but the family works.


    In the thread at AUGI the member that started it all replied that he figured out how to solve it after reading a post at BIM & BEAM. I tried using the formulas as well but found it was necessary to play the "two lines instead of one trick" to get it to behave.

    If you'd like to play around with the families I created doing this I've posted them HERE. I'd be interested if anyone can find simpler solutions.

    [Edit 08/20/2012: Alfredo Medina shared a solution at the AUGI thread that uses formulas to define the relationships consistently. CLICK to watch his video of it flexing. CLICK to download his family. (You'll need to log into AUGI to download it most likely)

    Saturday, December 31, 2011

    Show Your Constraints

    In Revit we can apply constraints (padlock and EQ) using dimensions. These dimensions can get deleted and if the person doing the deleting doesn't respond to the warning well...the constraint remains intact without any obvious visible evidence.


    Choosing Unconstrain will eliminate the constraint when the dimension is deleted. Unfortunately many users just click OK, leaving the constraint to come back and bite someone later, maybe themselves.

    For example, years ago, a friend started modeling a tall building. He locked the distance between a few different floors and then later deleted the string. Eventually he needed to change the floor to floor height and Revit crashed. I took a look at the model. When I used Zoom to Fit in an elevation view I noticed that a little padlock appeared when I selected a Level. Revit tends to display the icon for a constraint at the opposite end of what is being examined, usually off screen unfortunately (less clutter with other icons is my theory). Using Zoom to Fit meant I could see the whole level, and the constraint icon, like in this image at the far left.


    Software programmers "comment their code" so that it is easier to figure out what a section of code is intended to do later. It's etiquette, good practice, nice... Half the time it's self serving too. I've returned to some code I wrote months or years later pleased to find my own comment helping me remember why I did "that".

    To mimic this notion of "commenting our code", I frequently suggest that if this sort of constraint is really important then consider making a duplicate view called Level 1 - Constraints (or somesuch). Lock and constrain it there. With this special view any/everyone can see the constraints anytime they want and see why they are there because you can add a note saying so.