title: AutoCad XData vanishing issue
body: <p>I have a C# application that interfaces with AutoCad. It's job is to rip through all of the entities on a model and find the ones that apply to what we're doing by looking for the presence of specific XData tags.</p>
  
  <p>The problem is when the drafters move a block to any layer that is marked as "invisible" (i.e. turn layer off) then the xdata is not discoverable via the usual loop:</p>
  
  <p><code></p>
  
  <pre><code>foreach (AcadEntity ent in ACAD.ActiveDocument.ModelSpace)
  {
      ... get xData from the entity.
  }
  </code></pre>
  
  <p></code></p>
  
  <p>I've tried turning the layer on again using the following code:</p>
  
  <p><code></p>
  
  <pre><code>ACAD.ActiveDocument.Layers.Item("HIDDENLAYER").LayerOn = true;
  ACAD.Update();
  foreach...
  </code></pre>
  
  <p></code></p>
  
  <p>... but the xData doesn't seem to come back with it. It is as though moving it to an invisible layer stripped the XData from the object. That would be bad.</p>
  
  <p>Is there a "proper" way to get the XData from items on invisible layers?</p>
  
  <p>Thanks.</p>