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. Welcome to the second part of this article on the use of Materials within custom components. In this section we are going to create a cube that can have it’s material easily changed by the User from within a Project- ie you do NOT have to go back into the Family Editor in order to change it. For this example we do not need to start from scratch- we can just go back into the Family Editor and work with the cube that we formed in Part 1. Select the cube and then bring up it’s Element Properties Panel… 
In order to allow the material to be changed from within a Project we need to store the “value” of the material within a Parameter. Instead of clicking on the material name itself (now shown as “Glass”), click on the small grey box at the end of this line. These small grey boxes always represent links to Parameter Values rather than absolute values. So go ahead and click the grey box…  We now have a Panel which allows us to “Associate Family Parameter”. At present this panel is telling us that there is no parameters associated with the material property of this element. So let’s go ahead and add one. Select “Add Parameter” This will invoke the “Parameter Properties” control panel. Leave the Parameter type set on “Family Parameter”.
In the bottom half of the panel you can type “Cube Material” as the Parameter name. You can choose any name you like, it’s up to you. Now before you hit “OK”, change the parameter type from “Type” to “Instance”- in doing so, this will allow Users to specify a different material (if necessary) for EVERY SINGLE instance of the component (the Cube in our case) in the Project.
Our new Parameter now appears in the “Associate Family Parameter” panel. Click OK to confirm we wish to use this new parameter for the control of the material.  Notice how “Glass” is now greyed-out. Also notice how a little “=” sign has been placed on the grey box at the end of the line. Revit is telling you that the value of the material is controlled by a Parameter rather than a single, “static”, specific value. OK, we’re done! Let’s load our Cube into a project and see how it performs.  In the image above you can see that I’ve placed 7 instances of the component. All still have the default material applied to them. Remember, they had a default material of glass BEFORE we created the Parameter to control the material. So the Parameter has simply picked up the default material as it’s base value. Go ahead and select a cube, any one will do. Once selected, bring up it’s Element Properties panel…  Success! At the bottom of the panel we see our parameter (“Cube Material”) and it’s default value, “Glass”. You can now quite simply click on the material name and then select any material from the Materials Control Panel. Notice how you now have the FULL RANGE of materials from within the Project- and not just the 5 default ones that were available from within the Family Template file. Because we made the Parameter an “Instance Parameter” we have Revit hold a separate value for each and every Instance of this component within out Project. 
Hopefully you have found this article on Materials useful? If you have any feedback on this specific article, please feel free to use this Thread on our Forums.
|