Please Note: Our Discussion forums have moved. If you would like to discuss this article or any aspect of Revit, please do so at www.forums.revit.biz We will be more than pleased to help you with ANY Revit query.OK. So we’ve had a quick look at all the parameter types available to you when creating you own components. Let’s now go ahead and create a simple component that includes each of these parameters. For this example I’m going to use the Metric Generic Model template.. 
First of all I’m going to add all of the Parameters (ie DEFINE them) and THEN I’ll link them (through Labels, etc) to certain elements of my component. So from within the Family Editor I choose “Family Types”... 
And then “Add Parameter” from the Family Types control panel that appears….... 
Note: an URL-type parameter is already created for us within the template we chose- so no need to create another one! Let’s go ahead and create our parameters… 
And there we go! For clarity I’ve named my Parameters as the parameter-type. Of course in reality you will use more meaningful names for your parameters. Before we move on, take a close look at the image above. This is how the parameters appear in the “Family Types” control panel. Note how the “Value” column reflects the various types of parameters and the values that they can accept. For example the “Yes or No” parameter has a simple tick against it, whereas the “Material” parameter has “<By Category>” as the default material. You will also note that there is a “Formular” column. We can use this to automatically calculate values for some of our parameter if we wish.For example: Let’s make the Volume= Area x 23.4. All I do is type in this formular into the respective cell... 
By doing this, our Volume parameter now gets it’s value from this calculation. So if I go and make the value of Area equal to 47, Revit will update the value of “Volume”.. 
Let’s look at an example of how the Material parameter is used within a component. Keeping with our generic template, let’s go ahead and create a basic extrusion... 
You can see from above that I’ve just used the rectangle tool to sketch a simple outline for our extrusion. Now I bring up the Extrusion Properties panel, where I am able to define a material for this object... 
OK. Normally we would just click on the “<By Category>” box and select a material for this object. But want this object (ie the extrusion) to be able to adjust the material ITSELF according to the value stored with the “Material” parameter we created previously. To do this we click on the little grey box at the end of the line (ie the Material selection line). When we click on this box we see the following panel... 
This is the “Associate Family Parameter” control panel and it allows us to associate any Family Parameter that we’ve created (of the correct type, of course) with the parameter in question. You can see that Revit lists the parameters available to us- in our case, this is just the single material-type parameter we created (that we named “Material”). If we had created six material-type parameters (and named them “Material 1”, “Material 2”, etc) they would all be listed here for us to choose one to associate. Go ahead and select our “Material” parameter and click OK... 
Going back to Element Properties panel for the extrusion we are creating, you will see that the material selection has now turned grey. This is because you can no longer select a material directly from here. The material will be whatever the associated parameter value is set to. A small “=” sign on the grey box (on the right hand side) indicates that this parameter is getting it’s value from an associated parameter. Remember: If you need to be able to adjust this material for each instance of your component, you will need to ensure that you define the parameter as an “Instance parameter” at the time of creation (and not a Type Parameter). For a full explanation on the differences between Instance and Type parameters, check out this article here). The same concept applies to all the other parameter types. You can either just leave the parameters as part of the “family definition” and add values to them manually via the element properties panel. Or have them control parts of your component (ie the material as we have just seen, or lengths, angles, etc)- either directly by manually inputting their values, or automatically by having them calculate their own values from other parameters (by use of equations). If you have ever used a database programme (such as MS Access for example) you will start to appreciate how Revit is really just a graphical database that works in 3 dimensions. Hopefully this article has given you an insight into just how powerful and flexible custom parameters are. The possibilities really are only limited by your imagination. If you have any queries relating to this article or anything else you have read at Revit Zone, please feel free to discuss them in our Forums
|