2

1)I have a WallType and need to Change the compound structure of WallType.

   private void updateCompoundStructure(WallType wT)
{
  IList<Autodesk.Revit.DB.CompoundStructureLayer> csl = new     List<Autodesk.Revit.DB.CompoundStructureLayer>();

   csl.Add(new Autodesk.Revit.DB.CompoundStructureLayer()
                                {
                                    DeckEmbeddingType = deck,
                                    DeckProfileId = profileId,
                                    Function = structureFunction,
                                    LayerCapFlag = item.LayerCapFlag,
                                    MaterialId = materialId,
                                    Width = item.Thickness
                                });

CompoundStructure cs = CompoundStructure.CreateSimpleCompoundStructure(csl);
if (cs.IsValid(dbDoc, out IDictionary<int, CompoundStructureError> errMap, out IDictionary<int, int> twoLayerErrorMap))
                        {
                            wallType.SetCompoundStructure(cs);
                        }
}

The walltype compound structure is updated properly

But,CompoundStructureLayer.LayerId is the read-only field we cannot update it for all the CompoundStructureLayer's LayerId I get is like 0

2) when i read the compoundStructure form WallType it gives LayerID as at 0 th index as 0,

at 1 st index as 1

at 2nd inndex as 2... and so on

is there any way to Update The layerID of compound Structure? is there any workaround to achive that.

Arvind Maurya
  • 910
  • 12
  • 25
  • According to the [documentation](http://www.revitapidocs.com/2018.1/7b6ace8a-7810-5e6d-760e-642361fbe916.htm) no. The layerId does not provide a setter. Maybe reword your question with what you are trying to achieve. – Scrobi Sep 25 '18 at 11:00
  • Is there any workaround to achieve that? – Arvind Maurya Sep 25 '18 at 11:13
  • No. I think you are trying to solve the wrong problem. Why are you trying to update the `layerId`? – Scrobi Sep 25 '18 at 11:18
  • I need to find the core layer of CompoundStructure we can achieve this by cs.IsCoreLayer() function and it accept index or LayerID to determine the core layers. – Arvind Maurya Sep 25 '18 at 11:27
  • Can you not use `GetFirstCoreLayerIndex` or `GetLastCoreLayerIndex`? – Scrobi Sep 25 '18 at 11:37
  • Thanks for an idea, I will try it out. do you have sample related to that some thing. – Arvind Maurya Sep 25 '18 at 11:50
  • @Scrobi can you please provide a sample for GetFirstCoreLayerIndex example? – Arvind Maurya Sep 25 '18 at 13:34
  • see the usage in this blog [post](http://thebuildingcoder.typepad.com/blog/2012/03/updating-wall-compound-layer-structure.html) – Scrobi Sep 25 '18 at 13:45

0 Answers0