<?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: Set TARGET for all new viewports created with MVIEW? AutoCAD 2023 in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870622#M356409</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13082031"&gt;@j-dubya-merchant&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;UPDATE:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Another thing I just tried.&amp;nbsp; Still not as convenient as I would like (and very similar to what I've already tried), but still progress.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before even running the MVIEW command at all, go to the Model tab.&amp;nbsp; Use "DVIEW - POints" to set the target to 0,0,0 and set the camera to 0,0,1.&amp;nbsp; Or run a LISP routine / macro that does that.&lt;/P&gt;&lt;P&gt;DON'T ROTATE THE VIEW IN MODEL SPACE WITH SHIFT-MIDDLE CLICK (which I do frequently, especially if there's any 3D geometry in the drawing).&amp;nbsp; Go straight back to paper space.&lt;/P&gt;&lt;P&gt;Run "MVIEW - NEw".&amp;nbsp; Make the viewport like normal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I check the TARGET variable within that viewport, it's at 0,0,0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understand the implication of this correctly, every time I want to use MVIEW to make a new viewport, I first need to remember if I've rotate the view &lt;STRONG&gt;at all&lt;/STRONG&gt; using the View Cube.&amp;nbsp; If I have,&amp;nbsp;I have to run this "DVIEW - POints" command before I make another viewport.&amp;nbsp; So that's... something.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess it's slightly better than creating the viewport&amp;nbsp;&lt;STRONG&gt;first&lt;/STRONG&gt; and then trying to fix the target within the viewport&amp;nbsp;&lt;STRONG&gt;after&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that rotating the Model Space view with the View Cube (or with Shift-Middle Click) causes the TARGET variable to shift a &lt;STRONG&gt;lot&lt;/STRONG&gt;, and if there's geometry at varying elevations, that includes the Z component of the TARGET variable. "MVIEW - NEw" seems to just set you up to cut a viewport from however you left Model Space last time you were in it, so if you left Model Space looking at a wonky South-West-ish isometric, that's what it's gonna give you when you run "MVIEW - NEw", and the TARGET variable gets carried with it.&amp;nbsp; Panning in model space does not seem to affect the TARGET variable, but rotating the view definitely does.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Welp.&amp;nbsp; Nevermind.&amp;nbsp; Just tried this again.&amp;nbsp; Simply resetting the target in Model Space with DVIEW doesn't guarantee that the next viewport created with MVIEW will have the correct target value.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Oct 2025 20:22:49 GMT</pubDate>
    <dc:creator>j-dubya-merchant</dc:creator>
    <dc:date>2025-10-28T20:22:49Z</dc:date>
    <item>
      <title>Set TARGET for all new viewports created with MVIEW? AutoCAD 2023</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870456#M356396</link>
      <description>&lt;P&gt;I'm using AutoCAD 2023.&amp;nbsp; In paper space, I always use the "MVIEW - NEw" command to create new viewports.&amp;nbsp; It's super convenient -- it takes me to model space and lets me click 2 points to draw a frame around whatever geometry I want to see, and it takes me right back to paper space to select a scale and place it.&amp;nbsp; But I've just recently noticed an issue with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes, when I use CHSPACE for an object within that viewport to bring it into paper space, the elevation / Z coordinate of that object ends up being something other than 0, even though it was 0 while it was in model space, and I've learned that it has to do with the TARGET variable for that viewport.&amp;nbsp; Whenever I create a new viewport with "MVIEW - NEw", I don't get the chance to set the TARGET for the viewport.&amp;nbsp; It seems like it's automatically set based on whatever geometry happens to exist in model space at that moment.&amp;nbsp; This would normally be fine, except for the fact that sometimes the Z coordinate of the viewport TARGET is not 0 (particularly if there are any 3D solids in model space), which means that using CHSPACE for anything inside the viewport will cause it to end up with weird Z coordinates after it's moved to paper space.&amp;nbsp; This is a very minor issue, but it seems like something that should be fairly simple to resolve (although I may be naive).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thus far, I've found &lt;A href="https://forums.autodesk.com/t5/civil-3d-forum/best-way-to-set-viewport-s-target-z-to-0/td-p/8486663" target="_blank" rel="noopener"&gt;this forum post&lt;/A&gt; with someone looking for the same solution (but for a different problem).&amp;nbsp; It looks like it's about Civil 3D, so the only thing I was able to try from this post was using "DVIEW - POints" to reset the TARGET and Camera values (after entering MSPACE through the viewport).&amp;nbsp; Although this does successfully reset the target for the viewport, I have two main issues with this approach:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Changing the target point with DVIEW changes the view of the viewport (it centers it at the new target), which means I now have to manually adjust the viewport to refocus on what I had it set to before, which eliminates the convenience of using "MVIEW - NEw".&lt;/LI&gt;
&lt;LI&gt;This would have to be manually done for each viewport -- even less convenient.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The only thing that I've come up with thus far to ensure that every new viewport has the TARGET at 0,0,0 is to create a named view with that target, and when using MVIEW, selecting "NAmed" instead of "NEw" and creating a viewport of that named view, and then manually adjusting the borders to whatever geometry I want to show.&amp;nbsp; But this just doesn't seem like the most efficient way to accomplish this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something I just tried is running "MVIEW - NAmed" and creating a viewport with that named view (with the target at 0,0,0), and it seems that all viewports that I create immediately after using "MVIEW - NEw" have the same target (0,0,0).&amp;nbsp; I'm not sure if this is a consistent behavior, or if it's just dumb luck, but I'll take it for now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe I'm just too dead-set on using "MVIEW - NEw" because of how quick and convenient it is.&amp;nbsp; But I'm curious, when I use "MVIEW - NEw", instead of it just zooming out to view the entirety of model space and setting the TARGET automatically based on how much geometry is there (and where that geometry is), is there some way to manually (and consistently) set the TARGET as I'm creating the viewport?&amp;nbsp; Or pre-modify some settings / system variables that will make the TARGET consistent and predictable when I use "MVIEW - NEw"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13082031"&gt;@j-dubya-merchant&lt;/a&gt;&amp;nbsp;- Your post title was modified to add the product name and version and to increase findability - CGBenner&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 18:56:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870456#M356396</guid>
      <dc:creator>j-dubya-merchant</dc:creator>
      <dc:date>2025-10-28T18:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set TARGET for all new viewports created with MVIEW?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870470#M356397</link>
      <description>&lt;P&gt;Looks like there are a couple of options here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.google.com/search?q=autocad+can+I+set+the+target+without+using+dview&amp;amp;rlz=1C1GCEU_enUS922US922&amp;amp;oq=autocad+can+I+set+the+target+without+using+dview&amp;amp;gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRigATIHCAIQIRigAdIBCTIxMTU5ajBqN6gCALACAA&amp;amp;sourceid=chrome&amp;amp;ie=UTF-8" target="_blank"&gt;https://www.google.com/search?q=autocad+can+I+set+the+target+without+using+dview&amp;amp;rlz=1C1GCEU_enUS922US922&amp;amp;oq=autocad+can+I+set+the+target+without+using+dview&amp;amp;gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRigATIHCAIQIRigAdIBCTIxMTU5ajBqN6gCALACAA&amp;amp;sourceid=chrome&amp;amp;ie=UTF-8&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Even a quick Lisp to set it for you.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 18:42:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870470#M356397</guid>
      <dc:creator>AllenJessup</dc:creator>
      <dc:date>2025-10-28T18:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Set TARGET for all new viewports created with MVIEW?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870480#M356398</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1685"&gt;@AllenJessup&lt;/a&gt;, thanks for the quick reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure which options you're referring to.&amp;nbsp; The link in your reply is a Google search, one which is very similar to what I've already tried.&amp;nbsp; In fact, the first result is the thread that I referenced in my initial post (one which you've actually replied to, coincidentally!).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure which LISP routine you're referring to.&amp;nbsp; Unless you're referring to the routine found within the AI-generated response (which I tend to ignore, but decided to double-check this time).&amp;nbsp; This LISP routine would sadly not solve my problem, because it would be running the exact same command that I've already tried (using "DVIEW - POints" to reset the TARGET and Camera values).&amp;nbsp; The problem with this command is that it re-centers the view of the viewport and forces me to have to re-find the geometry that I wanted to show, which I want to avoid.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 18:59:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870480#M356398</guid>
      <dc:creator>j-dubya-merchant</dc:creator>
      <dc:date>2025-10-28T18:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Set TARGET for all new viewports created with MVIEW?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870541#M356401</link>
      <description>&lt;P&gt;Unfortunately I haven't had any experience with the MView command in years (and years). &lt;STRIKE&gt;The only thing I can think of is a workaround. After you have your viewport set using MView. Save that modelspace as a view, run the DView command to reset the target then reset the saved view view.&lt;/STRIKE&gt; No. The Target gets saved with the view. Posibley set OSNAPZ to 1. Making sure ELEVATION is set to 0. Then using MVIEW. That could be incorporated in a lisp.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 19:17:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870541#M356401</guid>
      <dc:creator>AllenJessup</dc:creator>
      <dc:date>2025-10-28T19:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: Set TARGET for all new viewports created with MVIEW? AutoCAD 2023</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870549#M356402</link>
      <description>&lt;P&gt;UPDATE:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Another thing I just tried.&amp;nbsp; Still not as convenient as I would like (and very similar to what I've already tried), but still progress.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before even running the MVIEW command at all, go to the Model tab.&amp;nbsp; Use "DVIEW - POints" to set the target to 0,0,0 and set the camera to 0,0,1.&amp;nbsp; Or run a LISP routine / macro that does that.&lt;/P&gt;&lt;P&gt;DON'T ROTATE THE VIEW IN MODEL SPACE WITH SHIFT-MIDDLE CLICK (which I do frequently, especially if there's any 3D geometry in the drawing).&amp;nbsp; Go straight back to paper space.&lt;/P&gt;&lt;P&gt;Run "MVIEW - NEw".&amp;nbsp; Make the viewport like normal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I check the TARGET variable within that viewport, it's at 0,0,0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understand the implication of this correctly, every time I want to use MVIEW to make a new viewport, I first need to remember if I've rotate the view &lt;STRONG&gt;at all&lt;/STRONG&gt; using the View Cube.&amp;nbsp; If I have,&amp;nbsp;I have to run this "DVIEW - POints" command before I make another viewport.&amp;nbsp; So that's... something.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess it's slightly better than creating the viewport&amp;nbsp;&lt;STRONG&gt;first&lt;/STRONG&gt; and then trying to fix the target within the viewport&amp;nbsp;&lt;STRONG&gt;after&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that rotating the Model Space view with the View Cube (or with Shift-Middle Click) causes the TARGET variable to shift a &lt;STRONG&gt;lot&lt;/STRONG&gt;, and if there's geometry at varying elevations, that includes the Z component of the TARGET variable. "MVIEW - NEw" seems to just set you up to cut a viewport from however you left Model Space last time you were in it, so if you left Model Space looking at a wonky South-West-ish isometric, that's what it's gonna give you when you run "MVIEW - NEw", and the TARGET variable gets carried with it.&amp;nbsp; Panning in model space does not seem to affect the TARGET variable, but rotating the view definitely does.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 19:25:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870549#M356402</guid>
      <dc:creator>j-dubya-merchant</dc:creator>
      <dc:date>2025-10-28T19:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Set TARGET for all new viewports created with MVIEW?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870578#M356404</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1685"&gt;@AllenJessup&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Unfortunately I haven't had any experience with the MView command in years (and years). &lt;STRIKE&gt;The only thing I can think of is a workaround. After you have your viewport set using MView. Save that modelspace as a view, run the DView command to reset the target then reset the saved view view.&lt;/STRIKE&gt; No. The Target gets saved with the view. Posibley set OSNAPZ to 1. Making sure ELEVATION is set to 0. Then using MVIEW. That could be incorporated in a lisp.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Interesting!&amp;nbsp; I hadn't heard of OSNAPZ before.&amp;nbsp; I just now started messing around with it to see what I could get it to do.&amp;nbsp; Sadly, changing OSNAPZ and ELEVATION doesn't seem to affect the TARGET value of viewports created with MVIEW (the only thing that seems to accomplish that is making sure the TARGET variable is already set in model space before creating the viewport), and it doesn't affect the elevation of objects brought into paper space with CHSPACE (still affected only by the viewport's TARGET value).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But!&amp;nbsp; I still find OSNAPZ very useful for something else!&amp;nbsp; I also work in Advance Steel a fair bit, and the detail views (analogous to AutoCAD's viewports) that are created with Advance Steel's camera system are... strange.&amp;nbsp; It basically draws lines, circles, arcs, etc., directly into paper space to mimic the 3D geometry (just at a smaller scale), but the Z coordinates of those lines / circles / arcs are all over the place, because they're based on the relative height of the actual objects in the 3D model.&amp;nbsp; This makes Intersection Snap Points a pain, as well as Sub-Object selection (Ctrl-double Click) for blocks with editable text if those blocks have been snapped to any of the Advance Steel Detail objects.&amp;nbsp; OSNAPZ might be a great workaround for this!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 19:43:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870578#M356404</guid>
      <dc:creator>j-dubya-merchant</dc:creator>
      <dc:date>2025-10-28T19:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Set TARGET for all new viewports created with MVIEW? AutoCAD 2023</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870603#M356406</link>
      <description>&lt;P&gt;Once a &lt;STRONG&gt;Vport's Target's Z&lt;/STRONG&gt; &lt;STRONG&gt;value&lt;/STRONG&gt; is changed, the next time you use the &lt;STRONG&gt;MVIEW&lt;/STRONG&gt; command to create a new &lt;STRONG&gt;Vport&lt;/STRONG&gt; in that &lt;STRONG&gt;Layout&lt;/STRONG&gt; the &lt;STRONG&gt;Target's Z value&lt;/STRONG&gt; matches with that change.&lt;/P&gt;&lt;P&gt;Use this &lt;STRONG&gt;vptar0&lt;/STRONG&gt; lisp function to change all &lt;STRONG&gt;Layout Vport's Target's Z value&lt;/STRONG&gt; to &lt;STRONG&gt;0&lt;/STRONG&gt;:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;; vptar0 sets all vports in each layout target's z value to 0
; OP:
; https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/td-p/13870456
; Note:
; To get single selected vport's target's z value:
; (getpropertyvalue (car(entsel)) "ViewTarget/Z")
; To set single selected vport's target's z value to 0:
; (setpropertyvalue (car(entsel)) "ViewTarget/Z" 0.0)
(defun c:vptar0 (/ ctab ss)
  (setq ctab (getvar "ctab")) ; save current layout
  (foreach lot (layoutlist) ; cycle through all layouts
   (if (setq ss (ssget "_X" (list '(0 . "VIEWPORT") '(-4 . "&amp;gt;") '(69 . 1) (cons 410 lot)))) ; select all vports in current layout
    (progn
     (setvar "ctab" lot) ; set current layout
     (foreach en (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))(setpropertyvalue en "ViewTarget/Z" 0)) ; sets each vport in current layout target's Z to 0
    ) ; progn
   ) ; if
  ) ; foreach
  (setvar "ctab" ctab) ; restore original layout
  (princ "\nAll Layout Vports Target Z set to 0.")
  (princ) ; clean exit
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 20:07:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870603#M356406</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2025-10-28T20:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set TARGET for all new viewports created with MVIEW? AutoCAD 2023</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870616#M356407</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1137264"&gt;@paullimapa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Once a &lt;STRONG&gt;Vport's Target's Z&lt;/STRONG&gt; &lt;STRONG&gt;value&lt;/STRONG&gt; is changed, the next time you use the &lt;STRONG&gt;MVIEW&lt;/STRONG&gt; command to create a new &lt;STRONG&gt;Vport&lt;/STRONG&gt; in that &lt;STRONG&gt;Layout&lt;/STRONG&gt; the &lt;STRONG&gt;Target's Z value&lt;/STRONG&gt; matches with that change.&lt;/P&gt;&lt;P&gt;Use this &lt;STRONG&gt;vptar0&lt;/STRONG&gt; lisp function to change all &lt;STRONG&gt;Layout Vport's Target's Z value&lt;/STRONG&gt; to &lt;STRONG&gt;0&lt;/STRONG&gt;:&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;LI-CODE lang="general"&gt;; vptar0 sets all vports in each layout target's z value to 0
; OP:
; https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/td-p/13870456
; Note:
; To get single selected vport's target's z value:
; (getpropertyvalue (car(entsel)) "ViewTarget/Z")
; To set single selected vport's target's z value to 0:
; (setpropertyvalue (car(entsel)) "ViewTarget/Z" 0.0)
(defun c:vptar0 (/ ctab ss)
  (setq ctab (getvar "ctab")) ; save current layout
  (foreach lot (layoutlist) ; cycle through all layouts
   (if (setq ss (ssget "_X" (list '(0 . "VIEWPORT") '(-4 . "&amp;gt;") '(69 . 1) (cons 410 lot)))) ; select all vports in current layout
    (progn
     (setvar "ctab" lot) ; set current layout
     (foreach en (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))(setpropertyvalue en "ViewTarget/Z" 0)) ; sets each vport in current layout target's Z to 0
    ) ; progn
   ) ; if
  ) ; foreach
  (setvar "ctab" ctab) ; restore original layout
  (princ "\nAll Layout Vports Target Z set to 0.")
  (princ) ; clean exit
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;Interesting!&amp;nbsp; Since the TARGET variable is read only, I wasn't sure if it could be changed directly, even with a LISP routine.&amp;nbsp; I might give this a try!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 20:17:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870616#M356407</guid>
      <dc:creator>j-dubya-merchant</dc:creator>
      <dc:date>2025-10-28T20:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Set TARGET for all new viewports created with MVIEW? AutoCAD 2023</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870622#M356409</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13082031"&gt;@j-dubya-merchant&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;UPDATE:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Another thing I just tried.&amp;nbsp; Still not as convenient as I would like (and very similar to what I've already tried), but still progress.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before even running the MVIEW command at all, go to the Model tab.&amp;nbsp; Use "DVIEW - POints" to set the target to 0,0,0 and set the camera to 0,0,1.&amp;nbsp; Or run a LISP routine / macro that does that.&lt;/P&gt;&lt;P&gt;DON'T ROTATE THE VIEW IN MODEL SPACE WITH SHIFT-MIDDLE CLICK (which I do frequently, especially if there's any 3D geometry in the drawing).&amp;nbsp; Go straight back to paper space.&lt;/P&gt;&lt;P&gt;Run "MVIEW - NEw".&amp;nbsp; Make the viewport like normal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I check the TARGET variable within that viewport, it's at 0,0,0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understand the implication of this correctly, every time I want to use MVIEW to make a new viewport, I first need to remember if I've rotate the view &lt;STRONG&gt;at all&lt;/STRONG&gt; using the View Cube.&amp;nbsp; If I have,&amp;nbsp;I have to run this "DVIEW - POints" command before I make another viewport.&amp;nbsp; So that's... something.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess it's slightly better than creating the viewport&amp;nbsp;&lt;STRONG&gt;first&lt;/STRONG&gt; and then trying to fix the target within the viewport&amp;nbsp;&lt;STRONG&gt;after&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that rotating the Model Space view with the View Cube (or with Shift-Middle Click) causes the TARGET variable to shift a &lt;STRONG&gt;lot&lt;/STRONG&gt;, and if there's geometry at varying elevations, that includes the Z component of the TARGET variable. "MVIEW - NEw" seems to just set you up to cut a viewport from however you left Model Space last time you were in it, so if you left Model Space looking at a wonky South-West-ish isometric, that's what it's gonna give you when you run "MVIEW - NEw", and the TARGET variable gets carried with it.&amp;nbsp; Panning in model space does not seem to affect the TARGET variable, but rotating the view definitely does.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Welp.&amp;nbsp; Nevermind.&amp;nbsp; Just tried this again.&amp;nbsp; Simply resetting the target in Model Space with DVIEW doesn't guarantee that the next viewport created with MVIEW will have the correct target value.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 20:22:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870622#M356409</guid>
      <dc:creator>j-dubya-merchant</dc:creator>
      <dc:date>2025-10-28T20:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set TARGET for all new viewports created with MVIEW? AutoCAD 2023</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870928#M356425</link>
      <description>&lt;P&gt;Try the attached lisp &lt;STRONG&gt;MV0.lsp&lt;/STRONG&gt;.&amp;nbsp; Instead of using the &lt;STRONG&gt;MVIEW&lt;/STRONG&gt; command to create your &lt;STRONG&gt;Vports&lt;/STRONG&gt;, use &lt;STRONG&gt;MV0&lt;/STRONG&gt; and &lt;STRONG&gt;Vports&lt;/STRONG&gt; created &lt;STRONG&gt;Target Z&lt;/STRONG&gt; value are set to &lt;STRONG&gt;0&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 02:15:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/set-target-for-all-new-viewports-created-with-mview-autocad-2023/m-p/13870928#M356425</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2025-10-29T02:15:51Z</dc:date>
    </item>
  </channel>
</rss>

