TheSwamp

Code Red => .NET => Topic started by: nobody on January 24, 2017, 04:21:13 PM

Title: How to Set Paperspace Viewport Styles?
Post by: nobody on January 24, 2017, 04:21:13 PM
I'm trying to change all my paperspace viewports to 2dwireframe, and am not certain why this isn't working. Anyone know?

Code - C#: [Select]
  1.  Database database = HostApplicationServices.WorkingDatabase;
  2.             using (Transaction transaction = database.TransactionManager.StartTransaction())
  3.             {
  4.                 ObjectIdCollection vports = database.GetViewports(true);
  5.                 foreach (ObjectId id in vports)
  6.                 {
  7.                     DBDictionary dict = (DBDictionary)transaction.GetObject(database.VisualStyleDictionaryId, OpenMode.ForRead);
  8.                     Viewport myvp = (Viewport)id.GetObject(OpenMode.ForWrite);
  9.                     myvp.VisualStyleId = dict.GetAt("2dwireframe");                
  10.                 }
  11.  
  12.                 transaction.Commit();
  13.             }
Title: Re: How to Set Paperspace Viewport Styles?
Post by: nobody on January 24, 2017, 04:32:46 PM
Nevermind. It is changing the style but the ucs icon remains in 3d (graphically at least).