Message 1 of 10
Not applicable
10-15-2017
06:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have read many forums on this and I still can't figure out why my code crashes AutoCAD. Some things I can do so simply in LISP are crazy in C#...
public static void SetCurrentLayoutTab(string tab)
{
using (DocumentLock lk = acDoc.LockDocument())
{
// Start a transaction in the new database
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
{
try
{
LayoutManager.Current.CurrentLayout = tab;
acTrans.Commit();
}
catch
{
acTrans.Abort();
}
}
}
}
Solved! Go to Solution.