Google Analytics (Hidden)

Saturday, March 23, 2013

Material Library weirdness

Ok, this must be one of the lesser known bugs in Revit. Due to it's specific nature and the fact that it only happens in a specific workflow...
But it drove me nuts for a few months, and I couldn't find any documentation on it. So here it goes...

Let's say you're starting a new company template. Or national standard for that matter. You're going all the way, which means you start a new template and select None as the default template. That means building a Material Library from scratch too. So you go at it. And some more... And then some... And when you are starting to lose it, dream about naming conventions and see hatch patterns floating around when you close your tired and weary eyes..., well you're about half way through.
It took me a full 8 days to get the Material Library to where it's at. But now it is freakin' bada$$.

Ok, not the point. Let's carry on...

Once done, I figured I should get some feedback so I sent it out to a few people. And I started a project based on my shiny new (new, not finished) Template. All went well, until I wanted to create a new Material based on Assets that I predefined in the adsklib-file but hadn't put in an actual Material. For instance: In the template, I created a bunch of different Physical Assets for concrete and structural steel to match different types. But I didn't put them in a Material because that's lunacy. In an average project, you have two or three different concrete types. I have 9 different Physical Assets. Besides, I don't want the architect messing around with that. So I created generic concrete materials WITHOUT the Physical Asset. Once a structural engineer defines which type of concrete goes where, the right one can be added to that specific Material.

So, I wanted to add a Physical Asset to my generic concrete material. It was a Floor, so I went down the usual road: Edit Type > Edit Structure > Select proper layer > Open Material Editor > Add Physical Asset. To my surprise (and horror): no Physical Assets present in my adsklib file... About the same time, I got an email from the guys to whom I sent out the Material Library. They couldn't open it up either...

Was my beautiful library FUBAR'ed before I got the chance to use it??? But that would be weird, cause when I was able to breathe again, I opened my template and there they were. All of them. In perfect shape. I could easily create an extra floor type, duplicate the generic concrete material and add the desired Physical Asset to it. Just not in my project, only in the template.

So I started looking online, but no joy. No mention of such problems what soever. I then contacted a Dutch reseller and sent them the same file. They could open it up perfectly well. He even sent me a video doing it.
I noticed he added and opened the Material Library through Manage > Additional Settings > Material Assets. And all the Assets are there, not a problem.
Also, he wasn't in a project based on my template. Just opened some random Revit project and added the library there.

This got me thinking:
1. Is it the template? Are we not supposed to create a Material Library from a Template Files? Or is it the workflow? Do you need to add a custom Material Library through Manage > Additional Settings > Material Assets to make it work?
2. What happens if I remove the Material Library from the template, and add it while in a project?

The answer to question one is: I don't know. We'll come to the "why don't you know?" later.
Question number 2 is interesting. Because this is the fix. If you unload the material library from the template, save it, close Revit, reopen, create a project from your template and add the Material Library there: not a problem. It's all there.

Now getting back to answer number one: it stays there. The above workflow is a definitive solution to the problem. Once loaded into the project you can reload the Material Library in your template. Then and when you create a new project from that template there won't be a problem. It's like the entire problem never existed.

Which makes investigating this somewhat problematic. Once fixed, you cannot recreate the problem. Unless you create a new blank template, with new custom Material Library with new Materials.
If you do that, and don't find any Materials in your project, well you now know how to fix it...