WallType assigning new CompoundStructure vs modify existing

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
I'm using Revit 2015 API to duplicate a wall type so that I can create custom types with new compound structures. I found some odd behaviour and wanted to know if there is something I'm missing or whether this is a bug.
My first approach was to duplicate a wall type of WallKind.Basic, create a list of layers with width, function and material id all set then create a new compound structure using CompoundStructure.CreateSimpleCompoundStructure() passing in my list of layers.
After assigning the new compound structure to the duplicated wall type, the new type was fine except that none of the materials were displayed correctly (all dark grey like the default material). Btw, the materials used are simple coloured materials without any appearance assests assigned. When I checked the properties and layer structure of the new wall type everything looked as it should, the correct layers were assigned and the layer structure preview even showed the layers in thier correct colours.
I tried a few things like working with duplicates of different wall types and re-assigning the materials to each layer again using SetMaterialId but nothing changed the behaviour.
Finally I tried using the existing compound structure of the duplicated wall type and used SetLayers() on it with the exact same list of layers I was using previously with CreateSimpleCompoundStructure() and everything worked fine, all layers displayed in correct colours. This confirms to me that the problem does not lie with the materials I'm using or the way I have constructed the layers, but is caused by assigning a compound structre created using CreateSimpleCompoundStructure.
So, in summary my problem is solved, but I'm interested if anyone knows why using CreateSimpleCompoundStructure doesn't work properly, is there a property I need to set somewhere or is it possibly a bug in the API?