title: Set Wall Instance Id into Parameter Wall Id
body: <p>I would like to put the wall ID's into the properties of the walls.</p>
  
  <p>The Code Builds but doesn't put the wall id into the parameter wall id for all the walls.</p>
  
  <p>I've tried without transactions and with. I'm under the impression it has to be carried out using them but I'm not getting the right result (or any result).</p>
  
  <p>public void InsertWallID()
          {</p>
  
  <pre><code>        Document doc = this.ActiveUIDocument.Document; 
  
          FilteredElementCollector collector =    new FilteredElementCollector(doc);
  
          ICollection&lt;Element&gt; WallEls =  collector.OfClass(typeof(FamilyInstance)).OfCategory(BuiltInCategory.OST_Walls).ToElements();
  
  
  using (Transaction trans = new Transaction(doc, "Change wall parameters values"))
  {
      trans.Start();
  
          int WallIDValue;
  
      foreach(Element WallEl in WallEls)
          {           
          ElementId WallId = WallEl.Id;
          WallIDValue = WallId.IntegerValue;
          if(WallEl.LookupParameter("WallID")==null)
          {
  
  
          Parameter wallparam = WallEl.LookupParameter("WallID") as Parameter;
              wallparam.Set(WallIDValue);
          }
              }
            trans.Commit();
          }
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Expected result:
  Each instance has its own id in their parameters. which would let me schedule the walls and their wall ID's</p>
  
  <p>Actual Result:
  No change to the parameter WallID as its still empty.</p>