Author Topic: Making a new View  (Read 3969 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Making a new View
« on: June 07, 2012, 06:01:34 AM »

Has anyone played around with making a new view.
Say :
Relative to WCS
X Axis = 310
XY Plane =30

This sort of thing :
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Draftek

  • Guest
Re: Making a new View
« Reply #1 on: June 07, 2012, 09:00:58 AM »
Only to create a zoom window effect in the current ucs.

Let us know how it goes, looks like fun.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Making a new View
« Reply #2 on: June 09, 2012, 02:07:50 AM »
I need to create some named views and just started testing and used some of the values from your screen shot, but noticed Editor.SetCurrentView() does not change the USC or create a thumbnail for the ViewTableRecord.
 
So I guess Matrix3d.AlignCoordinateSystem might need to be used with the Views Ucs property or just use Tony's commandline and use the 'Restore' option of the 'View' command for thumbnail and Ucs alignment?
 
Sorry Kerry for asking questions in your thread and not posting anything very helpful(thought it was closely related).
 
 
Code - C#: [Select]
  1.  
  2.          [CommandMethod("CreateHardCodeView")]
  3.         public void HardCodeView()
  4.         {
  5.             Document doc = Application.DocumentManager.MdiActiveDocument;
  6.             Database db = doc.Database;
  7.             Editor ed = doc.Editor;
  8.            
  9.             using (Transaction trx = db.TransactionManager.StartTransaction())
  10.             {
  11.                 ViewTableRecord vtr = new ViewTableRecord();
  12.                 vtr.IsPaperspaceView = false;
  13.                 vtr.Name = "HardCodeView";
  14.                 vtr.PerspectiveEnabled = false;
  15.                 vtr.ViewDirection = new Vector3d(0.56, -0.66, 0.5);
  16.                 vtr.Target = new Point3d(0, 0, 0);
  17.                 vtr.LensLength = 50;
  18.                 vtr.FrontClipEnabled = false;
  19.                 vtr.BackClipEnabled = false;
  20.                 vtr.Height = 4816.14;
  21.                 vtr.Width = 10535.30;
  22.                 vtr.SetUcs(new Point3d(100, 100, 0), new Vector3d(1.0, 0.0, 0.0), new Vector3d(0.0, 1.0, 0.0));
  23.                
  24.                 ViewTable vt = db.GetViewTable(OpenMode.ForWrite);
  25.                 vt.Add(vtr);
  26.                 trx.AddNewlyCreatedDBObject(vtr, true);            
  27.  
  28.                 trx.Commit();
  29.                 ed.SetCurrentView(vtr);
  30.             }
  31.         }
  32.  

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Making a new View
« Reply #3 on: June 09, 2012, 02:50:17 AM »

Thanks for the interest Jeff. I haven't been able to make time to get to this yet 
... it's a little way down my list still, and started as a casual ' I wonder' type thingy.

I'd imagined needing lots of calc's to set the camera position.

I don't want the UCS to change, just the view :: and to name the view.

I seem to recall Kean dealing with views/orbits in his ( I think) Kinect gestures experiments.

I'll do some research when I can make the time

Regards and thanks
kdub
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Making a new View
« Reply #4 on: June 09, 2012, 03:34:17 AM »
Snooped with MgdDbg

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Making a new View
« Reply #5 on: June 15, 2012, 01:19:12 AM »

This is an interim Build.
There a few things I'm not really satisfied with , but it does work ... so we're halfway there.

The attached solution targets AutoCAD 2013

Code - C#: [Select]
  1. // (C) CodeHimBelonga kdub 2012.06.15  
  2. //
  3.  
  4. using System;
  5. using Autodesk.AutoCAD.ApplicationServices;
  6. using Autodesk.AutoCAD.DatabaseServices;
  7. using Autodesk.AutoCAD.EditorInput;
  8. using Autodesk.AutoCAD.Geometry;
  9. using Autodesk.AutoCAD.Interop;
  10. using Autodesk.AutoCAD.Runtime;
  11. using ViewTest;
  12. using AcadApp = Autodesk.AutoCAD.ApplicationServices.Core.Application;
  13.  
  14. [assembly: ExtensionApplication(typeof (MyViewCommandsStartup))]
  15. [assembly: CommandClass(typeof (MyViewCommands))]
  16.  
  17. namespace ViewTest
  18. {
  19.     public class MyViewCommands
  20.     {
  21.         private Database db;
  22.         private Document doc;
  23.         private Editor ed;
  24.  
  25.         public MyViewCommands()
  26.         {
  27.             ActiveDoc = AcadApp.DocumentManager.MdiActiveDocument;
  28.         }
  29.  
  30.         private Document ActiveDoc
  31.         {
  32.             get { return doc; }
  33.             set
  34.             {
  35.                 doc = value;
  36.                 if (doc == null)
  37.                 {
  38.                     db = null;
  39.                     ed = null;
  40.                 }
  41.                 else
  42.                 {
  43.                     db = doc.Database;
  44.                     ed = doc.Editor;
  45.                 }
  46.             }
  47.         }
  48.  
  49.         //=======================================================================
  50.         private static Vector3d ViewDirection
  51.         {
  52.             get
  53.             {
  54.                 return new Vector3d(Math.Cos(AngleInXyPlane), Math.Sin(AngleInXyPlane),
  55.                                     Math.Tan(AngleFromXyPlane));
  56.             }
  57.         }
  58.         private static double AngleInXyPlane { get; set; }
  59.         private static double AngleFromXyPlane { get; set; }
  60.         private string ViewName { get; set; }
  61.         //=======================================================================
  62.         [CommandMethod("HCV1")]
  63.         public void Hcv01()
  64.         {
  65.             AngleInXyPlane = 310.0.DegreesToRadians();
  66.             AngleFromXyPlane = 30.0.DegreesToRadians();
  67.             ViewName = "ISO 310.30";
  68.             db.UpdateExt(true);
  69.             HardCodeView();
  70.         }
  71.  
  72.         //=======================================================================
  73.         [CommandMethod("HCV2")]
  74.         public void Hcv02()
  75.         {
  76.             AngleInXyPlane = 50.0.DegreesToRadians();
  77.             AngleFromXyPlane = 30.0.DegreesToRadians();
  78.             ViewName = "ISO 050.30";
  79.             db.UpdateExt(true);
  80.             HardCodeView();
  81.         }
  82.  
  83.         //=======================================================================
  84.         [CommandMethod("HCV3")]
  85.         public void HCV_03()
  86.         {
  87.             AngleInXyPlane = 230.0.DegreesToRadians();
  88.             AngleFromXyPlane = 30.0.DegreesToRadians();
  89.             ViewName = "ISO 230.30";
  90.             db.UpdateExt(true);
  91.             HardCodeView();
  92.         }
  93.  
  94.         //=======================================================================
  95.         [CommandMethod("HCV4")]
  96.         public void Hcv04()
  97.         {
  98.             AngleInXyPlane = 110.0.DegreesToRadians();
  99.             AngleFromXyPlane = 30.0.DegreesToRadians();
  100.             ViewName = "ISO 130.30";
  101.             db.UpdateExt(true);
  102.             HardCodeView();
  103.         }
  104.  
  105.         //=======================================================================
  106.         [CommandMethod("HCV5")]
  107.         public void Hcv05()
  108.         {
  109.             AngleInXyPlane = 270.0.DegreesToRadians();
  110.             AngleFromXyPlane = 30.0.DegreesToRadians();
  111.             ViewName = "ISO 270.30";
  112.             db.UpdateExt(true);
  113.             HardCodeView();
  114.         }
  115.         //=======================================================================
  116.         private void HardCodeView()
  117.         {
  118.             using (DocumentLock loc = doc.LockDocument())
  119.             {
  120.                 using (Transaction tr = db.TransactionManager.StartTransaction())
  121.                 {
  122.                     var vt = tr.GetObject(db.ViewTableId, OpenMode.ForRead) as ViewTable;
  123.                     ViewTableRecord vtr;
  124.  
  125.                     if (!vt.Has(ViewName))
  126.                     {
  127.                         vtr = MakeView();
  128.                         KdubTools.ZoomExtents();
  129.                         SaveView();
  130.                     }
  131.                     else // just restore the view
  132.                     {
  133.                         using (Transaction tr2 = db.TransactionManager.StartTransaction())
  134.                         {
  135.                             ed.SetCurrentView((ViewTableRecord) tr2.GetObject(vt[ViewName], OpenMode.ForRead));
  136.                             tr2.Commit();
  137.                         }
  138.                     }
  139.                     tr.Commit();
  140.                 }
  141.             }
  142.         }
  143.         //=======================================================================
  144.         private ViewTableRecord MakeView()
  145.         {
  146.             var vtr = new ViewTableRecord();
  147.             using (Transaction tr1 = db.TransactionManager.StartTransaction())
  148.             {
  149.                 vtr.IsPaperspaceView = false;
  150.                 vtr.PerspectiveEnabled = false;
  151.                 vtr.ViewDirection = ViewDirection;
  152.                 vtr.LensLength = 50;
  153.                 vtr.FrontClipEnabled = false;
  154.                 vtr.BackClipEnabled = false;
  155.                 var vt = (ViewTable) tr1.GetObject(db.ViewTableId, OpenMode.ForWrite);
  156.                 vt.Add(vtr);
  157.                 tr1.AddNewlyCreatedDBObject(vtr, true);
  158.                 tr1.Commit();
  159.                 ed.SetCurrentView(vtr);
  160.             }
  161.             return vtr;
  162.         }
  163.         //=======================================================================
  164.         private void SaveView()
  165.         {
  166.             using (Transaction tr2 = db.TransactionManager.StartTransaction())
  167.             {
  168.                 var vt = (ViewTable) tr2.GetObject(db.ViewTableId, OpenMode.ForWrite);
  169.                 ViewTableRecord vtr = ed.GetCurrentView();
  170.                 vtr.Name = ViewName;
  171.                 vt.Add(vtr);
  172.                 tr2.AddNewlyCreatedDBObject(vtr, true);
  173.                 tr2.Commit();
  174.                 ed.SetCurrentView(vtr);
  175.             }
  176.         }
  177.     }
  178.     //=======================================================================
  179.     //=======================================================================
  180.     public static class KdubTools
  181.     {
  182.         public static double DegreesToRadians(this double degrees)
  183.         {
  184.             return (degrees*0.017453292519943295);
  185.         }
  186.  
  187.         public static void ZoomExtents()
  188.         {
  189.             {
  190.                 // cast as  Autodesk.AutoCAD.Interop.AcadApplication
  191.                 ((AcadApplication) Application.AcadApplication).ZoomExtents();
  192.             }
  193.         }
  194.     }
  195.     //=======================================================================
  196.     //=======================================================================
  197.     public class MyViewCommandsStartup : IExtensionApplication
  198.     {
  199.         #region IExtensionApplication Members
  200.  
  201.         public void Initialize()
  202.         {
  203.             try
  204.             {
  205.                 AcadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage(
  206.                     "\nMyViewCommands: \n{0}, {1}, {2}, {3}, {4}", "HCV1", "HCV2", "HCV3", "HCV4", "HCV5");
  207.             }
  208.             catch (System.Exception e)
  209.             {
  210.                 AcadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage(
  211.                     "\n\nError in {0}.Initialize():\n{1}", GetType().FullName, e.ToString());
  212.             }
  213.         }
  214.  
  215.         public void Terminate()
  216.         {
  217.             //TODO: add code to clean up things when the ExtApp terminates.
  218.         }
  219.  
  220.         #endregion
  221.     }
  222. }
  223.  
  224.  
  225.  
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Draftek

  • Guest
Re: Making a new View
« Reply #6 on: June 18, 2012, 08:29:06 AM »
Thanks.
I have a personal project this may be handy for.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Making a new View
« Reply #7 on: June 18, 2012, 08:59:17 AM »
Draftek,
When you have a look at it ;
I cheated with the ViewWidth and ViewHeight by making the view, zooming extents, then saving the view.
This saves a lot of hoop jumping involved in calculating the ViewWidth and ViewHeight.
The byproduct is that there is an unnamed view left in the ViewTable. I was going to delete unnamed Views but decided to walk away for now and spend some effort with the view calcs later when I have the time.

.. the current code is a reasonable starting point I think.

Enjoy !

Regards
kdub.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Making a new View
« Reply #8 on: September 07, 2012, 10:04:54 PM »
Draftek,
When you have a look at it ;
I cheated with the ViewWidth and ViewHeight by making the view, zooming extents, then saving the view.
This saves a lot of hoop jumping involved in calculating the ViewWidth and ViewHeight.
The byproduct is that there is an unnamed view left in the ViewTable. I was going to delete unnamed Views but decided to walk away for now and spend some effort with the view calcs later when I have the time.

.. the current code is a reasonable starting point I think.

Enjoy !

Regards
kdub.

I'd like to thank Philippe Leefsma at ADN for resolving this issue for me.
See Philippe's code at :
http://adndevblog.typepad.com/autocad/2012/09/how-to-mimic-command-vpoint-rotate-with-the-net-api.html
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Making a new View
« Reply #9 on: September 09, 2012, 06:48:59 PM »
A new build to play with.
coded for AutoCAD 2013 ... see comments in using statements.

edit: changed PromptStringOptions to fail for un-named view.
Code - C#: [Select]
  1.             if ((psr.Status != PromptStatus.OK) || (psr.StringResult == string.Empty)){
  2.                 return;
  3.             }

Code - C#: [Select]
  1.  
  2. / (C) CodeHimBelonga kdub 2012.06.15  
  3. // Revised 2012.09.09
  4. // http://www.theswamp.org/index.php?topic=41937.0
  5.  
  6. using System;
  7. using Autodesk.AutoCAD.ApplicationServices;
  8. using Autodesk.AutoCAD.DatabaseServices;
  9. using Autodesk.AutoCAD.EditorInput;
  10. using Autodesk.AutoCAD.Geometry;
  11. using Autodesk.AutoCAD.Runtime;
  12. //using MgdAcadApp = Autodesk.AutoCAD.ApplicationServices.Application; // <= ac2012
  13. using MgdAcadApp = Autodesk.AutoCAD.ApplicationServices.Core.Application; // == ac2013
  14. using Exception = System.Exception;
  15.  
  16. [assembly: ExtensionApplication(typeof (ViewTest.MyViewCommandsStartup))]
  17. [assembly: CommandClass(typeof (ViewTest.MyViewCommands))]
  18.  
  19. namespace ViewTest
  20. {
  21.     public class MyViewCommands
  22.     {
  23.         private Database db;
  24.         private Document doc;
  25.         private Editor ed;
  26.  
  27.         public MyViewCommands()
  28.         {
  29.             ActiveDoc = MgdAcadApp.DocumentManager.MdiActiveDocument;
  30.         }
  31.  
  32.         private Document ActiveDoc
  33.         {
  34.             get { return doc; }
  35.             set
  36.             {
  37.                 doc = value;
  38.                 if (doc == null) {
  39.                     db = null;
  40.                     ed = null;
  41.                 }
  42.                 else {
  43.                     db = doc.Database;
  44.                     ed = doc.Editor;
  45.                 }
  46.             }
  47.         }
  48.  
  49.         //------------------------------------------------------------------
  50.         [CommandMethod("iso5030")]
  51.         public void iso5030()
  52.         {
  53.             BuildNewView(viewName: "iso5030", angleInXyPlane: 50, angleFromXyPlane: 30, zoomE: true);
  54.         }
  55.  
  56.         //------------------------------------------------------------------
  57.         [CommandMethod("iso13030")]
  58.         public void iso13030()
  59.         {
  60.             BuildNewView(viewName: "iso13030", angleInXyPlane: 130, angleFromXyPlane: 30, zoomE: true);
  61.         }
  62.  
  63.         //------------------------------------------------------------------
  64.         [CommandMethod("iso23030")]
  65.         public void iso23030()
  66.         {
  67.             BuildNewView(viewName: "iso23030", angleInXyPlane: 230, angleFromXyPlane: 30, zoomE: true);
  68.         }
  69.  
  70.         //------------------------------------------------------------------
  71.         [CommandMethod("iso27030")]
  72.         public void iso27030()
  73.         {
  74.             BuildNewView(viewName: "iso27030", angleInXyPlane: 270, angleFromXyPlane: 30, zoomE: true);
  75.         }
  76.  
  77.         //------------------------------------------------------------------
  78.         [CommandMethod("iso31030")]
  79.         public void iso31030()
  80.         {
  81.             BuildNewView(viewName: "iso31030", angleInXyPlane: 310, angleFromXyPlane: 30, zoomE: true);
  82.         }
  83.         //------------------------------------------------------------------
  84.         [CommandMethod("isoPrompt")]
  85.         public void isoPrompt()
  86.         {
  87.             PromptStringOptions pso = new PromptStringOptions("\nEnter VIEW name");
  88.             pso.AllowSpaces = true;
  89.             PromptResult psr = ed.GetString(pso);
  90.             if ((psr.Status != PromptStatus.OK) || (psr.StringResult == string.Empty)){
  91.                 return;
  92.             }
  93.  
  94.             PromptDoubleOptions pdo1 = new PromptDoubleOptions("\nEnter angle in XY plane from X axis (deg): ");
  95.             PromptDoubleResult pdr1 = ed.GetDouble(pdo1);
  96.             if (pdr1.Status != PromptStatus.OK) {
  97.                 return;
  98.             }
  99.  
  100.             PromptDoubleOptions pdo2 = new PromptDoubleOptions("\nEnter angle from XY plane (deg): ");
  101.             PromptDoubleResult pdr2 = ed.GetDouble(pdo2);
  102.             if (pdr2.Status != PromptStatus.OK) {
  103.                 return;
  104.             }
  105.  
  106.             PromptKeywordOptions pko = new PromptKeywordOptions("\nZoom Extents?");
  107.             pko.AllowNone = false;
  108.             pko.Keywords.Add("Yes");
  109.             pko.Keywords.Add("No");
  110.             pko.Keywords.Default = "Yes";
  111.             PromptResult pkr = ed.GetKeywords(pko);
  112.  
  113.             if (pkr.Status != PromptStatus.OK) {
  114.                 return;
  115.             }
  116.  
  117.             BuildNewView(viewName: (psr.StringResult),
  118.                         angleInXyPlane: (pdr1.Value),
  119.                         angleFromXyPlane: (pdr2.Value),
  120.                         zoomE: (pkr.StringResult == "Yes") );
  121.         }
  122.         //------------------------------------------------------------------
  123.         private void BuildNewView(string viewName, double angleInXyPlane, double angleFromXyPlane, bool zoomE)
  124.         {
  125.             using (Transaction tr = db.TransactionManager.StartTransaction()) {
  126.                 ViewTable vt = tr.GetObject(db.ViewTableId, OpenMode.ForRead) as ViewTable;
  127.                 ViewTableRecord newView = ed.GetCurrentView();
  128.  
  129.                 newView.ViewDirection = ComputeViewDirection(DegToRad(angleInXyPlane),
  130.                                                              DegToRad(angleFromXyPlane));
  131.                 newView.Name = viewName;
  132.  
  133.                 if (zoomE) {
  134.                     db.UpdateExt(true);
  135.                     Extents3d extents = new Extents3d(db.Extmin, db.Extmax);
  136.                     SetViewToExtents(extents, newView);
  137.                 }
  138.  
  139.                 if (!vt.Has(viewName)) {
  140.                     vt.UpgradeOpen();
  141.                     vt.Add(newView);
  142.                     tr.AddNewlyCreatedDBObject(newView, true);
  143.                 }
  144.  
  145.                 using (ViewTableRecord vtr = new ViewTableRecord()) {
  146.                     vtr.CopyFrom(newView);
  147.                     ed.SetCurrentView(vtr);
  148.                 }
  149.  
  150.                 tr.Commit();
  151.             }
  152.         }
  153.  
  154.         //------------------------------------------------------------------
  155.         private Vector3d ComputeViewDirection(double angleInXyPlane, double angleFromXyPlane)
  156.         {
  157.             Vector3d v1 = Vector3d.XAxis.RotateBy(angleInXyPlane, Vector3d.ZAxis);
  158.             Vector3d v2 = v1.CrossProduct(Vector3d.ZAxis);
  159.             Vector3d viewDir = v1.RotateBy(angleFromXyPlane, v2);
  160.             return viewDir;
  161.         }
  162.  
  163.         //------------------------------------------------------------------
  164.         private void SetViewToExtents(Extents3d extents, AbstractViewTableRecord view)
  165.         {
  166.             // Get the screen aspect ratio to calculate the height and width
  167.  
  168.             double scrRatio = (view.Width/view.Height);
  169.  
  170.             // Prepare Matrix for DCS to WCS transformation
  171.             // For DCS target point is the origin
  172.             // WCS Xaxis is twisted by twist angle
  173.             // Tranform the extents to the DCS defined by the viewdir
  174.  
  175.             Matrix3d matWCS2DCS = Matrix3d.PlaneToWorld(view.ViewDirection);
  176.             matWCS2DCS = Matrix3d.Displacement(view.Target - Point3d.Origin)*matWCS2DCS;
  177.             matWCS2DCS = Matrix3d.Rotation(-view.ViewTwist, view.ViewDirection, view.Target)*matWCS2DCS;
  178.             matWCS2DCS = matWCS2DCS.Inverse();
  179.             extents.TransformBy(matWCS2DCS);
  180.  
  181.             // Width of the extents in current view
  182.             // Height of the extents in current view
  183.             // Get the view center point
  184.  
  185.             double width = (extents.MaxPoint.X - extents.MinPoint.X);
  186.             double height = (extents.MaxPoint.Y - extents.MinPoint.Y);
  187.             Point2d center = new Point2d((extents.MaxPoint.X + extents.MinPoint.X)*0.5,
  188.                                          (extents.MaxPoint.Y + extents.MinPoint.Y)*0.5);
  189.  
  190.             // Check if the width 'fits' in current window
  191.             // if not then get the new height as per
  192.             // the viewports aspect ratio
  193.  
  194.             if (width > (height*scrRatio)) {
  195.                 height = width/scrRatio;
  196.             }
  197.  
  198.             view.Height = height;
  199.             view.Width = height*scrRatio;
  200.             view.CenterPoint = center;
  201.         }
  202.  
  203.         //------------------------------------------------------------------
  204.         private double DegToRad(double deg)
  205.         {
  206.             return deg*Math.PI/180.0;
  207.         }
  208.  
  209.         //------------------------------------------------------------------
  210.     }
  211.  
  212.     //=======================================================================
  213.     //=======================================================================
  214.     public class MyViewCommandsStartup : IExtensionApplication
  215.     {
  216.         #region IExtensionApplication Members
  217.  
  218.         public void Initialize()
  219.         {
  220.             try {
  221.                 MgdAcadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage(
  222.                     "\nMyViewCommands: \n{0}, {1}, {2}, {3}, {4}, {5}",
  223.                     "iso5030", "iso13030", "iso23030", "iso27030", "iso31030", "isoPrompt"
  224.                 );
  225.             }
  226.             catch (Exception e) {
  227.                 MgdAcadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage(
  228.                     "\n\nError in {0}.Initialize():\n{1}", GetType().FullName, e.ToString());
  229.             }
  230.         }
  231.  
  232.         public void Terminate()
  233.         {
  234.             //TODO: add code to clean up things when the ExtApp terminates.
  235.         }
  236.  
  237.         #endregion
  238.     }
  239. }
  240.  
« Last Edit: September 09, 2012, 07:04:44 PM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Making a new View
« Reply #10 on: September 09, 2012, 07:15:54 PM »
The command line showing the Initialize() message.

Quote

Command: COMMANDLINE

Command:
Command:
Command: NETLOAD

MyViewCommands:
iso5030, iso13030, iso23030, iso27030, iso31030, isoPrompt
Command: ISOPROMPT

Enter VIEW name: vv 12

Enter angle in XY plane from X axis (deg): 320

Enter angle from XY plane (deg): 35

Zoom Extents? [Yes/No] <Yes>:
Regenerating model.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.