<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Changing 3D View to Top View in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4363236#M48403</link>
    <description>&lt;P&gt;Yes, there is a command to do it however the smooth view scrolling is disabled in that command if invoked from a script, so it's not so nice &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Aug 2013 15:37:20 GMT</pubDate>
    <dc:creator>fenton_webb</dc:creator>
    <dc:date>2013-08-12T15:37:20Z</dc:date>
    <item>
      <title>Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4352166#M48400</link>
      <description>&lt;P&gt;doc.SendStringToExecute("-view\ntop\n", true, false, false);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, I know this would change the view.&lt;/P&gt;&lt;P&gt;But I need to do this in the middle of some process. (I tried it, but the next step gets executed before view change is done.)&lt;/P&gt;&lt;P&gt;I am changing the view to use&amp;nbsp;SelectWindowPolygon().&lt;/P&gt;&lt;P&gt;So I need to do this by lines of codes. (So that the view change gets done before the next step.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a couple solutions but the codes contain some methods that is not supported in ARX 2007.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone can give me something I can start with, it would be very appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI, I am using ARX 2007 with C#&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2013 09:39:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4352166#M48400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-02T09:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4354813#M48401</link>
      <description>&lt;P&gt;Did you see this &lt;A href="http://through-the-interface.typepad.com/through_the_interface/2009/02/smoothly-transitioning-between-3d-autocad-views-using-net---part-1.html" target="_blank"&gt;http://through-the-interface.typepad.com/through_the_interface/2009/02/smoothly-transitioning-between-3d-autocad-views-using-net---part-1.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2013 21:50:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4354813#M48401</guid>
      <dc:creator>fenton_webb</dc:creator>
      <dc:date>2013-08-05T21:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4362757#M48402</link>
      <description>Yes, I looked at it. It looks little complicated.&lt;BR /&gt;I just hoped if there is any easier way to do it. (Since there is a command to do it.)&lt;BR /&gt;But I guess it is worth trying...&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 12 Aug 2013 11:44:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4362757#M48402</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-12T11:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4363236#M48403</link>
      <description>&lt;P&gt;Yes, there is a command to do it however the smooth view scrolling is disabled in that command if invoked from a script, so it's not so nice &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2013 15:37:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4363236#M48403</guid>
      <dc:creator>fenton_webb</dc:creator>
      <dc:date>2013-08-12T15:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4364303#M48404</link>
      <description>&lt;P&gt;Actually, I do not quite need the animation effect.&lt;/P&gt;&lt;P&gt;I need to change the view to use Editor.SelectWindowPolygon()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, I came up with this~~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Document doc = Application.DocumentManager.MdiActiveDocument;            
Editor ed = doc.Editor;
Manager gsm = doc.GraphicsManager;
int vp = Convert.ToInt32(Application.GetSystemVariable("CVPORT"));
using (View view = gsm.GetGsView(vp, true))
{
	ViewTableRecord v = new ViewTableRecord();	
	v.SetUcs(view.Position, Vector3d.XAxis, Vector3d.YAxis);
	ed.SetCurrentView(v);
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This quite "LOOKS" acting right, but the result is weird.&lt;/P&gt;&lt;P&gt;If I use Editor.SelectWindowPolygon() (with the same polygon), it catches different objects (compared to the result I get by entering "-view top ", then run the Editor.SelectWindowsPolygon() ).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to check why this is happening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone knows the reason, any comment would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2013 09:59:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4364303#M48404</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-13T09:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4365097#M48405</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can synchrously call&amp;nbsp; the VIEW command P/Invoking acedCmd or using the &lt;A target="_blank" href="http://www.theswamp.org/index.php?topic=43113.msg483306#msg483306"&gt;Tony Tanzillo's wrapper&lt;/A&gt; for non-public Editor.RunCommand() method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also use the following method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        private void SetViewTop()
        {
            Document doc = AcAp.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;

            Extents3d extents = db.TileMode ?
                new Extents3d(db.Extmin, db.Extmax) :
                (short)Application.GetSystemVariable("CVPORT") == 1 ?
                    new Extents3d(db.Pextmin, db.Pextmax) :
                    new Extents3d(db.Extmin, db.Extmax);

            using (Transaction tr = db.TransactionManager.StartTransaction())
            using (ViewTableRecord view = ed.GetCurrentView())
            {
                Matrix3d WCS2DCS =
                    Matrix3d.Rotation(-view.ViewTwist, view.ViewDirection, view.Target) *
                    Matrix3d.Displacement(view.Target - Point3d.Origin);

                extents.TransformBy(WCS2DCS.Inverse());

                view.ViewDirection = Vector3d.ZAxis;
                view.Width = extents.MaxPoint.X - extents.MinPoint.X;
                view.Height = extents.MaxPoint.Y - extents.MinPoint.Y;
                view.CenterPoint = new Point2d(
                    (extents.MinPoint.X + extents.MaxPoint.X) / 2.0,
                    (extents.MinPoint.Y + extents.MaxPoint.Y) / 2.0);
                ed.SetCurrentView(view);
                tr.Commit();
            }
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2013 17:52:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4365097#M48405</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2013-08-13T17:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4366762#M48406</link>
      <description>&lt;P&gt;I'am glad you solve your probem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a more generic method to set any orthogonal and isometric view and some commands to set these views from the numpad.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;

[assembly: CommandClass(typeof(ViewSample.CommandMethods))]

namespace ViewSample
{
    public class CommandMethods
    {
        enum ViewDirection { Top, Bottom, Front, Back, Left, Right, SeIso, SwIso, NeIso, NwIso }

        private void SetView(ViewDirection vDir)
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;

            Vector3d viewDir = new Vector3d();
            switch (vDir)
            {
                case ViewDirection.Top:
                    viewDir = Vector3d.ZAxis; break;
                case ViewDirection.Bottom:
                    viewDir = Vector3d.ZAxis.Negate(); break;
                case ViewDirection.Front:
                    viewDir = Vector3d.YAxis.Negate(); break;
                case ViewDirection.Back:
                    viewDir = Vector3d.YAxis; break;
                case ViewDirection.Left:
                    viewDir = Vector3d.XAxis.Negate(); break;
                case ViewDirection.Right:
                    viewDir = Vector3d.XAxis; break;
                case ViewDirection.SeIso:
                    viewDir = new Vector3d(1.0, -1.0, 1.0); break;
                case ViewDirection.SwIso:
                    viewDir = new Vector3d(-1.0, -1.0, 1.0); break;
                case ViewDirection.NeIso:
                    viewDir = new Vector3d(1.0, 1.0, 1.0); break;
                case ViewDirection.NwIso:
                    viewDir = new Vector3d(-1.0, 1.0, 1.0); break;
            }
&lt;BR /&gt;            db.updateext(true);
            Extents3d extents = db.TileMode ?
                new Extents3d(db.Extmin, db.Extmax) :
                (int)Application.GetSystemVariable("CVPORT") == 1 ?
                    new Extents3d(db.Pextmin, db.Pextmax) :
                    new Extents3d(db.Extmin, db.Extmax);

            using (Transaction tr = db.TransactionManager.StartTransaction())
            using (ViewTableRecord view = ed.GetCurrentView())
            {
                Matrix3d viewTransform =
                    Matrix3d.PlaneToWorld(viewDir)
                    .PreMultiplyBy(Matrix3d.Displacement(view.Target - Point3d.Origin))
                    .PreMultiplyBy(Matrix3d.Rotation(-view.ViewTwist, view.ViewDirection, view.Target))
                    .Inverse();

                extents.TransformBy(viewTransform);

                view.ViewDirection = viewDir;
                view.Width = (extents.MaxPoint.X - extents.MinPoint.X) * 1.2;
                view.Height = (extents.MaxPoint.Y - extents.MinPoint.Y) * 1.2;
                view.CenterPoint = new Point2d(
                    (extents.MinPoint.X + extents.MaxPoint.X) / 2.0,
                    (extents.MinPoint.Y + extents.MaxPoint.Y) / 2.0);
                ed.SetCurrentView(view);
                tr.Commit();
            }
        }

        [CommandMethod("0")]
        public void ViewBottom()
        {
            SetView(ViewDirection.Bottom);
        }

        [CommandMethod("1")]
        public void ViewSouthWestIso()
        {
            SetView(ViewDirection.SwIso);
        }

        [CommandMethod("2")]
        public void ViewFront()
        {
            SetView(ViewDirection.Front);
        }

        [CommandMethod("3")]
        public void ViewSeIso()
        {
            SetView(ViewDirection.SeIso);
        }

        [CommandMethod("4")]
        public void ViewLeft()
        {
            SetView(ViewDirection.Left);
        }

        [CommandMethod("5")]
        public void ViewTop()
        {
            SetView(ViewDirection.Top);
        }

        [CommandMethod("6")]
        public void ViewSouthEastIso()
        {
            SetView(ViewDirection.Right);
        }

        [CommandMethod("7")]
        public void ViewNorthWestIso()
        {
            SetView(ViewDirection.NwIso);
        }

        [CommandMethod("8")]
        public void ViewBack()
        {
            SetView(ViewDirection.Back);
        }

        [CommandMethod("9")]
        public void ViewNorthEastIso()
        {
            SetView(ViewDirection.NeIso);
        }
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2013 19:11:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4366762#M48406</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2013-08-14T19:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4366838#M48407</link>
      <description>&lt;P&gt;There is one command I use all the time to out of 3d and back to my current usc, or back to original world. &amp;nbsp;This always puts me back on track.&lt;/P&gt;&lt;P&gt;PLAN&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2013 19:35:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4366838#M48407</guid>
      <dc:creator>jaboone</dc:creator>
      <dc:date>2013-08-14T19:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4428411#M48408</link>
      <description>&lt;P&gt;Hi! I found the code posted by _gile very interesting; is there a way to set these fixed views on an offscreen device? Device.Add() accepts GraphicsSystem.View objects that are quite different from ViewTableRecord objects so I can't understand how to do the same calculations.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2013 09:36:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/4428411#M48408</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-16T09:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/7267004#M48409</link>
      <description>&lt;P&gt;i was wondering if you could show me where this scrip is save to as i am not to familiar with the location.&lt;/P&gt;&lt;P&gt;thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;kevin&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 22:41:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/7267004#M48409</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-31T22:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/7267070#M48410</link>
      <description>&lt;P&gt;Use UCS to setup any type of view save it to current view then use PLAN to set 2d to that coordinate. &amp;nbsp;One of the UCS's is 3 point. &amp;nbsp;I mostly use that to switch between a front or side view. &amp;nbsp;Not sure what you are asking.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 23:40:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/7267070#M48410</guid>
      <dc:creator>jaboone</dc:creator>
      <dc:date>2017-07-31T23:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/7267088#M48411</link>
      <description>&lt;P&gt;what i am asking is how do i get the above script, to use numbers to choose the view in autocad,&amp;nbsp;&lt;/P&gt;&lt;P&gt;eg 5 = PLan view, 2 = front view etc...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;kevin&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 23:55:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/7267088#M48411</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-31T23:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/7267395#M48412</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above code is not a script, it's a .NET code (C#) which have to be compiled into a DLL and load in AutoCAD with the NETLOAD command (or any other loading mechanism).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Probably easier to use, the following AutoLISP code does the same thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;;;; Vue prédéfinies depuis le pavé numérique (gile)
;;; 0 = Bas
;;; 1 = Isométrie sud Ouest
;;; 2 = Avant
;;; 3 = Isométrie sud Est
;;; 4 = Gauche
;;; 5 = Haut
;;; 6 = Droite
;;; 7 = Isométrie Nord Ouest
;;; 8 = Arrière
;;; 9 = Isométrie Nord Est

(mapcar
  '(lambda (f v)
     (eval (list 'defun
		 f
		 nil
		 (list 'command "_.view" v)
		 '(princ)
	   )
     )
   )
  '(c:0 c:1 c:2 c:3 c:4 c:5 c:6 c:7 c:8 c:9)
  '("_bottom"	"_swiso"    "_front"	"_seiso"    "_left"
    "_top"	"_right"    "_nwiso"	"_back"	    "_neiso"
   )
)&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2017 04:40:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/7267395#M48412</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-08-01T04:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/10836955#M48413</link>
      <description>&lt;P&gt;Hi Gilles, (Salut)&lt;/P&gt;&lt;P&gt;This is an old topic but I don't manage to set the&amp;nbsp;ViewDirection of the view with two points : the observation point (3D), and the target point (3D). The view's width is not a problem, I just want this fck view be right compared to my two points. Have you ever developed something like this ?&lt;/P&gt;&lt;P&gt;Best regards (en te remerciant),&lt;/P&gt;&lt;P&gt;Olivier&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 23:35:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/10836955#M48413</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-21T23:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/10837409#M48414</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this ?&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;        [CommandMethod("SETVIEW")]
        public static void SetViewCmd()
        {
            var ed = AcAp.DocumentManager.MdiActiveDocument.Editor;
            var ppo = new PromptPointOptions("\nSource point: ");
            var ppr = ed.GetPoint(ppo);
            if (ppr.Status == PromptStatus.OK)
            {
                var source = ppr.Value;
                ppo.Message = "\nTarget point: ";
                ppo.BasePoint = source;
                ppo.UseBasePoint = true;
                ppr = ed.GetPoint(ppo);
                if (ppr.Status == PromptStatus.OK)
                {
                    var target = ppr.Value;
                    var viewDir = source.GetVectorTo(target).TransformBy(ed.CurrentUserCoordinateSystem);
                    using (var view = ed.GetCurrentView())
                    {
                        view.ViewDirection = viewDir;
                        ed.SetCurrentView(view);
                    }
                }
            }
        }&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Dec 2021 07:40:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/10837409#M48414</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2021-12-22T07:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/10837521#M48415</link>
      <description>&lt;P&gt;Hi Gilles,&lt;/P&gt;&lt;P&gt;Thanks a lot for your help.&lt;/P&gt;&lt;P&gt;In fact I get the same result that this I have computed (and to be honnest more complicated than yours, so thanks). And due to the fact your code gives me the same bad result, that helped me to find that my view had a ViewTwist different of 0, that created the issue.&lt;/P&gt;&lt;P&gt;Now all is fine, that's good.&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Olivier&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 08:53:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/10837521#M48415</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-22T08:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/11446522#M48416</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;, your script above has been very helpful, but its doing one thing that I cant understand.&lt;/P&gt;&lt;P&gt;I have a DWG file which is a block that has been exported using he WBLOCK command (see attached file I_Furn_Misc_Pingpong.dwg)&lt;/P&gt;&lt;P&gt;Im using your code within my script to switch between each of the different views, and then take a screenshot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the screenshots below, which were taken by my code, you can see that they are all coming out as expected, except for the "North-East" view, which is too zoomed in&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="block-top.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1120717iDE7F754EC514FF29/image-size/medium?v=v2&amp;amp;px=400" role="button" title="block-top.png" alt="block-top.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="block-ne.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1120720iA3DF46EAFADEC639/image-size/medium?v=v2&amp;amp;px=400" role="button" title="block-ne.png" alt="block-ne.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="block-nw.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1120718iD921DDAC20AAB9BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="block-nw.png" alt="block-nw.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="block-se.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1120719i50B4D148C9B43D98/image-size/medium?v=v2&amp;amp;px=400" role="button" title="block-se.png" alt="block-se.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="block-sw.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1120721i939AC7253B423834/image-size/medium?v=v2&amp;amp;px=400" role="button" title="block-sw.png" alt="block-sw.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ive managed to work out that its always the first isometric view that has this problem. If i tell it to take a different isometric view first, that one has the same problem.&lt;/P&gt;&lt;P&gt;If i tell it to take the north east first, then a different one, then the north east one again, the second attempt at the north east one comes out correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea what might be causing this behaviour?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 20:01:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/11446522#M48416</guid>
      <dc:creator>jhdempsey</dc:creator>
      <dc:date>2022-09-26T20:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Changing 3D View to Top View</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/11447238#M48417</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3133087"&gt;@jhdempsey&lt;/a&gt;, thanks to report.&lt;/P&gt;
&lt;P&gt;There was a mistake in the operations order.&lt;/P&gt;
&lt;P&gt;This one seems to work as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;

[assembly: CommandClass(typeof(ViewSample.CommandMethods))]

namespace ViewSample
{
    public class CommandMethods
    {
        enum ViewDirection { Top, Bottom, Front, Back, Left, Right, SeIso, SwIso, NeIso, NwIso }

        private void SetView(ViewDirection vDir)
        {
            var doc = Application.DocumentManager.MdiActiveDocument;
            var db = doc.Database;
            var ed = doc.Editor;

            Vector3d viewDir;
            switch (vDir)
            {
                case ViewDirection.Top:
                default:
                    viewDir = Vector3d.ZAxis; break;
                case ViewDirection.Bottom:
                    viewDir = Vector3d.ZAxis.Negate(); break;
                case ViewDirection.Front:
                    viewDir = Vector3d.YAxis.Negate(); break;
                case ViewDirection.Back:
                    viewDir = Vector3d.YAxis; break;
                case ViewDirection.Left:
                    viewDir = Vector3d.XAxis.Negate(); break;
                case ViewDirection.Right:
                    viewDir = Vector3d.XAxis; break;
                case ViewDirection.SeIso:
                    viewDir = new Vector3d(1.0, -1.0, 1.0); break;
                case ViewDirection.SwIso:
                    viewDir = new Vector3d(-1.0, -1.0, 1.0); break;
                case ViewDirection.NeIso:
                    viewDir = new Vector3d(1.0, 1.0, 1.0); break;
                case ViewDirection.NwIso:
                    viewDir = new Vector3d(-1.0, 1.0, 1.0); break;
            }

            using (var view = ed.GetCurrentView())
            {
                view.ViewDirection = viewDir;
                ed.SetCurrentView(view);
                db.UpdateExt(true);
                
                var viewTransform =
                    Matrix3d.WorldToPlane(viewDir) *
                    Matrix3d.Displacement(view.Target.GetAsVector().Negate()) *
                    Matrix3d.Rotation(view.ViewTwist, view.ViewDirection, view.Target);

                var extents = db.TileMode ?
                    new Extents3d(db.Extmin, db.Extmax) :
                    (int)Application.GetSystemVariable("CVPORT") == 1 ?
                        new Extents3d(db.Pextmin, db.Pextmax) :
                        new Extents3d(db.Extmin, db.Extmax);
                extents.TransformBy(viewTransform);

                view.Width = (extents.MaxPoint.X - extents.MinPoint.X) * 1.2;
                view.Height = (extents.MaxPoint.Y - extents.MinPoint.Y) * 1.2;
                view.CenterPoint = new Point2d(
                    (extents.MinPoint.X + extents.MaxPoint.X) / 2.0,
                    (extents.MinPoint.Y + extents.MaxPoint.Y) / 2.0);
                ed.SetCurrentView(view);
            }
        }

        [CommandMethod("0")]
        public void ViewBottom()
        {
            SetView(ViewDirection.Bottom);
        }

        [CommandMethod("1")]
        public void ViewSouthWestIso()
        {
            SetView(ViewDirection.SwIso);
        }

        [CommandMethod("2")]
        public void ViewFront()
        {
            SetView(ViewDirection.Front);
        }

        [CommandMethod("3")]
        public void ViewSeIso()
        {
            SetView(ViewDirection.SeIso);
        }

        [CommandMethod("4")]
        public void ViewLeft()
        {
            SetView(ViewDirection.Left);
        }

        [CommandMethod("5")]
        public void ViewTop()
        {
            SetView(ViewDirection.Top);
        }

        [CommandMethod("6")]
        public void ViewSouthEastIso()
        {
            SetView(ViewDirection.Right);
        }

        [CommandMethod("7")]
        public void ViewNorthWestIso()
        {
            SetView(ViewDirection.NwIso);
        }

        [CommandMethod("8")]
        public void ViewBack()
        {
            SetView(ViewDirection.Back);
        }

        [CommandMethod("9")]
        public void ViewNorthEastIso()
        {
            SetView(ViewDirection.NeIso);
        }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 06:57:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-3d-view-to-top-view/m-p/11447238#M48417</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2022-09-27T06:57:29Z</dc:date>
    </item>
  </channel>
</rss>

