Author Topic: How to Set Paperspace Viewport Styles?  (Read 1455 times)

0 Members and 1 Guest are viewing this topic.

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
How to Set Paperspace Viewport Styles?
« 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.             }

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: How to Set Paperspace Viewport Styles?
« Reply #1 on: January 24, 2017, 04:32:46 PM »
Nevermind. It is changing the style but the ucs icon remains in 3d (graphically at least).