
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a problem! When I load a dwg file, i set all invisible layers to visible!The layer properties has been set to visible, but the entities on those invisible layers still can't see。 After that I change the layout,just change the 'model' to 'layout1' Then change back to 'model' . All entities is visible!
I mean what's the matter with that and how I can Solve the problem?
private void AddNewLayer(Document doc)
{
if (doc.IsReadOnly)
return;
using (DocumentLock m_DocumentLock = doc.LockDocument())
{
string name = doc.Name;
using (Transaction tr = doc.Database.TransactionManager.StartTransaction())
{
LayerTable lt = (LayerTable)tr.GetObject(doc.Database.LayerTableId, OpenMode.ForWrite);
SymbolTableEnumerator symbolTableEnumerator = lt.GetEnumerator();
LayerTableRecord activerecord = null;
while (symbolTableEnumerator.MoveNext() == true)
{
ObjectId objEntr = (ObjectId)symbolTableEnumerator.Current;
LayerTableRecord ltr = (LayerTableRecord)tr.GetObject(objEntr, OpenMode.ForWrite);
if (ltr.IsOff)
{
ltr.IsOff = false;
}
}
tr.Commit();
}
}
}
Solved! Go to Solution.