<?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: in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891318#M163415</link>
    <description>If you're working with AutoCAD2000, then you can calculate the zoom scale from the viewport's normal data (i.e. you don't need to&lt;BR /&gt;
work with XData):&lt;BR /&gt;
&lt;BR /&gt;
(defun tst (/ ed)&lt;BR /&gt;
  (setq ed (entget (car (entsel))))&lt;BR /&gt;
  (/ (cdr (assoc 41 ed)) (cdr (assoc 45 ed)))&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
This is possible because in AutoCAD2000, the data is no longer stored as XData.  For compatibility with existing LISP programs,&lt;BR /&gt;
when you do an entget and ask for the XData, we use the actual data to make up the appropriate XData values to be returned by&lt;BR /&gt;
entget.&lt;BR /&gt;
&lt;BR /&gt;
Peter Farrell wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Carefully worded answer, but not the scale of a viewport from paper space only.  This gives the scale of the active model space&lt;BR /&gt;
&amp;gt; viewport&lt;BR /&gt;
&amp;gt; or recently active viewport.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; 1. Out of curiosity where is this recently active viewport information stored.&lt;BR /&gt;
&amp;gt; 2. is there an equally elegant means to acquire the scale of&lt;BR /&gt;
&amp;gt; any viewport you pick *from paperspace only*.  Frank's answer&lt;BR /&gt;
&amp;gt; was good, is there a better one?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; P. Farrell</description>
    <pubDate>Wed, 27 Oct 1999 17:02:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>1999-10-27T17:02:52Z</dc:date>
    <item>
      <title>Viewport Scale From Paper Space Only??</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891310#M163407</link>
      <description>I'm working on a few viewport tools,&lt;BR /&gt;
Trim Viewport,&lt;BR /&gt;
Break Viewport,&lt;BR /&gt;
Scale Viewport,&lt;BR /&gt;
Resize Viewport,&lt;BR /&gt;
etc....&lt;BR /&gt;
&lt;BR /&gt;
Is there anyway to get the scale of the viewport without, toggling&lt;BR /&gt;
into model space in some form?  Trans requires the viewport to be active, the viewctr/viewsize method does as well...&lt;BR /&gt;
&lt;BR /&gt;
P. Farrell</description>
      <pubDate>Tue, 26 Oct 1999 21:16:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891310#M163407</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-26T21:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Viewport Scale From Paper Space Only??</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891311#M163408</link>
      <description>The following snippet shows how to calculate the viewport scale. You'll&lt;BR /&gt;
probably want to replace the ENTSEL call with a TBLOBJNAME call to automte&lt;BR /&gt;
the process:&lt;BR /&gt;
&lt;BR /&gt;
(defun c:vpscale ()&lt;BR /&gt;
  (setq e      (car (entsel "\nSelect a viewport: "))&lt;BR /&gt;
 elist  (entget e '("ACAD"))&lt;BR /&gt;
 pscale (cdr (assoc 41 elist))&lt;BR /&gt;
 xdata  (cdr (nth 0 (cdr (assoc -3 elist))))&lt;BR /&gt;
 c      0&lt;BR /&gt;
  )&lt;BR /&gt;
  (foreach n xdata&lt;BR /&gt;
    (if (= (car n) 1040)&lt;BR /&gt;
      (progn&lt;BR /&gt;
 (setq c (1+ c))&lt;BR /&gt;
 (if (= c 2)&lt;BR /&gt;
   (setq mscale (cdr n))&lt;BR /&gt;
 )&lt;BR /&gt;
      )&lt;BR /&gt;
    )&lt;BR /&gt;
  )&lt;BR /&gt;
  (/ pscale mscale)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
Peter Farrell &lt;PFARRELL&gt; wrote in message&lt;BR /&gt;
news:7v55le$c3f27@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; I'm working on a few viewport tools,&lt;BR /&gt;
&amp;gt; Trim Viewport,&lt;BR /&gt;
&amp;gt; Break Viewport,&lt;BR /&gt;
&amp;gt; Scale Viewport,&lt;BR /&gt;
&amp;gt; Resize Viewport,&lt;BR /&gt;
&amp;gt; etc....&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Is there anyway to get the scale of the viewport without, toggling&lt;BR /&gt;
&amp;gt; into model space in some form?  Trans requires the viewport to be active,&lt;BR /&gt;
the viewctr/viewsize method does as well...&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; P. Farrell&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/PFARRELL&gt;</description>
      <pubDate>Tue, 26 Oct 1999 21:47:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891311#M163408</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-26T21:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Viewport Scale From Paper Space Only??</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891312#M163409</link>
      <description>Mr. Farrell,&lt;BR /&gt;
&lt;BR /&gt;
Both R14 and A2K have an Express tool that will give you the scale of a&lt;BR /&gt;
viewport from either modelspace or paperspace.  If you're already inside the&lt;BR /&gt;
viewport, VPSCALE will automatically spit out the paperspace to modelspace&lt;BR /&gt;
scale.  If not, you will be prompted to select the viewport.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Eugene N. Kilmer&lt;BR /&gt;
Owner/Mag Drafting</description>
      <pubDate>Tue, 26 Oct 1999 21:54:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891312#M163409</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-26T21:54:41Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891313#M163410</link>
      <description>Thanks, I think it was a case of brain freeze...&lt;BR /&gt;
I didn't even bother to look at the extended data!&lt;BR /&gt;
My old vpdata routine used a jump back and forth into&lt;BR /&gt;
the viewport, instead of xdata.&lt;BR /&gt;
&lt;BR /&gt;
Thanks, all better.&lt;BR /&gt;
&lt;BR /&gt;
P.Farrell</description>
      <pubDate>Tue, 26 Oct 1999 23:28:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891313#M163410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-26T23:28:18Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891314#M163411</link>
      <description>The current modelspace viewport scale can be found&lt;BR /&gt;
with this (from Paper or Model space).&lt;BR /&gt;
&lt;BR /&gt;
(defun xpfact ()&lt;BR /&gt;
   (caddr (trans '(0 0 1) 2 3))&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
Peter Farrell wrote:&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Thanks, I think it was a case of brain freeze...&lt;BR /&gt;
&amp;gt; I didn't even bother to look at the extended data!&lt;BR /&gt;
&amp;gt; My old vpdata routine used a jump back and forth into&lt;BR /&gt;
&amp;gt; the viewport, instead of xdata.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Thanks, all better.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; P.Farrell&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
/*********************************************************/&lt;BR /&gt;
/*    Tony Tanzillo     Design Automation Consulting     */&lt;BR /&gt;
/* Programming &amp;amp; Customization for AutoCAD &amp;amp; Compatibles */&lt;BR /&gt;
/* ----------------------------------------------------- */&lt;BR /&gt;
/*            tony.tanzillo@worldnet.att.net             */&lt;BR /&gt;
/*    http://ourworld.compuserve.com/homepages/tonyt     */&lt;BR /&gt;
/*********************************************************/</description>
      <pubDate>Wed, 27 Oct 1999 13:28:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891314#M163411</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-27T13:28:46Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891315#M163412</link>
      <description>Absolutely correct. The only reason I even came up with the alternative&lt;BR /&gt;
solution is he stated that requiring the viewport to be active was a problem&lt;BR /&gt;
for him.&lt;BR /&gt;
&lt;BR /&gt;
Tony Tanzillo &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:3816FE0E.34ABCF88@worldnet.att.net...&lt;BR /&gt;
&amp;gt; The current modelspace viewport scale can be found&lt;BR /&gt;
&amp;gt; with this (from Paper or Model space).&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (defun xpfact ()&lt;BR /&gt;
&amp;gt;    (caddr (trans '(0 0 1) 2 3))&lt;BR /&gt;
&amp;gt; )&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Peter Farrell wrote:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Thanks, I think it was a case of brain freeze...&lt;BR /&gt;
&amp;gt; &amp;gt; I didn't even bother to look at the extended data!&lt;BR /&gt;
&amp;gt; &amp;gt; My old vpdata routine used a jump back and forth into&lt;BR /&gt;
&amp;gt; &amp;gt; the viewport, instead of xdata.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Thanks, all better.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; P.Farrell&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; /*********************************************************/&lt;BR /&gt;
&amp;gt; /*    Tony Tanzillo     Design Automation Consulting     */&lt;BR /&gt;
&amp;gt; /* Programming &amp;amp; Customization for AutoCAD &amp;amp; Compatibles */&lt;BR /&gt;
&amp;gt; /* ----------------------------------------------------- */&lt;BR /&gt;
&amp;gt; /*            tony.tanzillo@worldnet.att.net             */&lt;BR /&gt;
&amp;gt; /*    http://ourworld.compuserve.com/homepages/tonyt     */&lt;BR /&gt;
&amp;gt; /*********************************************************/&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Wed, 27 Oct 1999 15:50:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891315#M163412</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-27T15:50:11Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891316#M163413</link>
      <description>Carefully worded answer, but not the scale of a viewport from paper space only.  This gives the scale of the active model space&lt;BR /&gt;
viewport&lt;BR /&gt;
or recently active viewport.&lt;BR /&gt;
&lt;BR /&gt;
1. Out of curiosity where is this recently active viewport information stored.&lt;BR /&gt;
2. is there an equally elegant means to acquire the scale of&lt;BR /&gt;
any viewport you pick *from paperspace only*.  Frank's answer&lt;BR /&gt;
was good, is there a better one?&lt;BR /&gt;
&lt;BR /&gt;
P. Farrell</description>
      <pubDate>Wed, 27 Oct 1999 16:11:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891316#M163413</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-27T16:11:13Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891317#M163414</link>
      <description>I think you may have misunderstood Tony's response. It works fine from&lt;BR /&gt;
paperspace. It simply reports the scale of the active viewport. It would be&lt;BR /&gt;
simple enough to walk through the available viewports to find the one you're&lt;BR /&gt;
looking for and set it active prior to calling xpfact.&lt;BR /&gt;
&lt;BR /&gt;
Peter Farrell &lt;PFARRELL&gt; wrote in message&lt;BR /&gt;
news:7v7861$gq826@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Carefully worded answer, but not the scale of a viewport from paper space&lt;BR /&gt;
only.  This gives the scale of the active model space&lt;BR /&gt;
&amp;gt; viewport&lt;BR /&gt;
&amp;gt; or recently active viewport.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; 1. Out of curiosity where is this recently active viewport information&lt;BR /&gt;
stored.&lt;BR /&gt;
&amp;gt; 2. is there an equally elegant means to acquire the scale of&lt;BR /&gt;
&amp;gt; any viewport you pick *from paperspace only*.  Frank's answer&lt;BR /&gt;
&amp;gt; was good, is there a better one?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; P. Farrell&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/PFARRELL&gt;</description>
      <pubDate>Wed, 27 Oct 1999 16:19:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891317#M163414</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-27T16:19:08Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891318#M163415</link>
      <description>If you're working with AutoCAD2000, then you can calculate the zoom scale from the viewport's normal data (i.e. you don't need to&lt;BR /&gt;
work with XData):&lt;BR /&gt;
&lt;BR /&gt;
(defun tst (/ ed)&lt;BR /&gt;
  (setq ed (entget (car (entsel))))&lt;BR /&gt;
  (/ (cdr (assoc 41 ed)) (cdr (assoc 45 ed)))&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
This is possible because in AutoCAD2000, the data is no longer stored as XData.  For compatibility with existing LISP programs,&lt;BR /&gt;
when you do an entget and ask for the XData, we use the actual data to make up the appropriate XData values to be returned by&lt;BR /&gt;
entget.&lt;BR /&gt;
&lt;BR /&gt;
Peter Farrell wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Carefully worded answer, but not the scale of a viewport from paper space only.  This gives the scale of the active model space&lt;BR /&gt;
&amp;gt; viewport&lt;BR /&gt;
&amp;gt; or recently active viewport.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; 1. Out of curiosity where is this recently active viewport information stored.&lt;BR /&gt;
&amp;gt; 2. is there an equally elegant means to acquire the scale of&lt;BR /&gt;
&amp;gt; any viewport you pick *from paperspace only*.  Frank's answer&lt;BR /&gt;
&amp;gt; was good, is there a better one?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; P. Farrell</description>
      <pubDate>Wed, 27 Oct 1999 17:02:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891318#M163415</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-27T17:02:52Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891319#M163416</link>
      <description>No I did not misunderstand...&lt;BR /&gt;
&lt;BR /&gt;
I do not know how to make a viewport active short of toggling to model space, and setting the current viewport, which is not an&lt;BR /&gt;
acceptable solution&lt;BR /&gt;
in this case, from *paperspace only* is the key factor here as you noted.&lt;BR /&gt;
&lt;BR /&gt;
P. Farrell</description>
      <pubDate>Wed, 27 Oct 1999 18:26:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891319#M163416</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-27T18:26:00Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891320#M163417</link>
      <description>I don't know how _elegant_ it is, but here's my version...&lt;BR /&gt;
&lt;BR /&gt;
(defun c:vpscalefactor ( / epk elist)&lt;BR /&gt;
  (if (eq 1 (getvar "tilemode"))&lt;BR /&gt;
    (prompt "\n** Command not allowed unless TILEMODE is set to 0 **")&lt;BR /&gt;
    (if (eq 1 (getvar "cvport"))&lt;BR /&gt;
      (while (or (setq epk (entsel "\nSelect VIEWPORT: "))&lt;BR /&gt;
                 (eq 7 (getvar "errno"))&lt;BR /&gt;
             )&lt;BR /&gt;
        (if (and epk (setq elist (entget (car epk) '("ACAD"))))&lt;BR /&gt;
          (if (eq "VIEWPORT" (cdr (assoc 0 elist)))&lt;BR /&gt;
            (prompt&lt;BR /&gt;
              (strcat&lt;BR /&gt;
                "\nVIEWPORT scale is 1:"&lt;BR /&gt;
                (rtos (/ (cdr (nth 7 (cadr (assoc -3 elist)))) (cdr (assoc&lt;BR /&gt;
41 elist))))&lt;BR /&gt;
              )&lt;BR /&gt;
            )&lt;BR /&gt;
            (prompt (strcat "\nInvalid selection: " (cdr (assoc 0 elist))))&lt;BR /&gt;
          )&lt;BR /&gt;
        )&lt;BR /&gt;
      )&lt;BR /&gt;
      (prompt (strcat "\nVIEWPORT scale is 1:" (rtos (last (trans '(0 0 1) 3&lt;BR /&gt;
2)))))&lt;BR /&gt;
    )&lt;BR /&gt;
  )&lt;BR /&gt;
  (princ)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
Jaysen&lt;BR /&gt;
&lt;BR /&gt;
Peter Farrell wrote in message &amp;lt;7v7861$gq826@adesknews2.autodesk.com&amp;gt;...&lt;BR /&gt;
&lt;SNIP&gt;&lt;BR /&gt;
&amp;gt;2. is there an equally elegant means to acquire the scale of&lt;BR /&gt;
&amp;gt;any viewport you pick *from paperspace only*.  Frank's answer&lt;BR /&gt;
&amp;gt;was good, is there a better one?&lt;/SNIP&gt;</description>
      <pubDate>Wed, 27 Oct 1999 19:41:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891320#M163417</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-27T19:41:57Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891321#M163418</link>
      <description>That's correct, the viewport must be active. &lt;BR /&gt;
&lt;BR /&gt;
What precisely is the reason why you can't &lt;BR /&gt;
switch to MSPACE to make a selected viewport &lt;BR /&gt;
active? &lt;BR /&gt;
&lt;BR /&gt;
(PS "not an acceptable solution" is not an &lt;BR /&gt;
acceptable answer).&lt;BR /&gt;
&lt;BR /&gt;
Peter Farrell wrote:&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; No I did not misunderstand...&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I do not know how to make a viewport active short of toggling to model space, and setting the current viewport, which is not an&lt;BR /&gt;
&amp;gt; acceptable solution&lt;BR /&gt;
&amp;gt; in this case, from *paperspace only* is the key factor here as you noted.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; P. Farrell&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
/*********************************************************/&lt;BR /&gt;
/*    Tony Tanzillo     Design Automation Consulting     */&lt;BR /&gt;
/* Programming &amp;amp; Customization for AutoCAD &amp;amp; Compatibles */&lt;BR /&gt;
/* ----------------------------------------------------- */&lt;BR /&gt;
/*            tony.tanzillo@worldnet.att.net             */&lt;BR /&gt;
/*    http://ourworld.compuserve.com/homepages/tonyt     */&lt;BR /&gt;
/*********************************************************/</description>
      <pubDate>Wed, 27 Oct 1999 20:21:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891321#M163418</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-27T20:21:51Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891322#M163419</link>
      <description>Tony Tanzillo &lt;TONY.TANZILLO&gt; wrote in message news:38175EDF.59AF6846@worldnet.att.net...&lt;BR /&gt;
&amp;gt; That's correct, the viewport must be active.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; What precisely is the reason why you can't&lt;BR /&gt;
&amp;gt; switch to MSPACE to make a selected viewport&lt;BR /&gt;
&amp;gt; active?&lt;BR /&gt;
&lt;BR /&gt;
In my case, I am reading the Viewport scale as part of a right click&lt;BR /&gt;
menu, and the MSPACE method causes the viewport to unselect.&lt;BR /&gt;
Its just a matter of consistency with (noun-verb) commands.&lt;BR /&gt;
In other words the user expects the entity to remain highlighted, not&lt;BR /&gt;
to unhighlight, not to flicker, etc. until a command is actually entered.&lt;BR /&gt;
&lt;BR /&gt;
I ended up using the xdata method to resolve the issue.&lt;BR /&gt;
&lt;BR /&gt;
P. Farrell&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Wed, 27 Oct 1999 21:28:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891322#M163419</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-27T21:28:17Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891323#M163420</link>
      <description>Nicely done! Didn't know about that one. Thanks.&lt;BR /&gt;
&lt;BR /&gt;
Art Cooney &lt;ARTC&gt; wrote in message&lt;BR /&gt;
news:3817303C.F9982064@autodesk.com...&lt;BR /&gt;
&amp;gt; If you're working with AutoCAD2000, then you can calculate the zoom scale&lt;BR /&gt;
from the viewport's normal data (i.e. you don't need to&lt;BR /&gt;
&amp;gt; work with XData):&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (defun tst (/ ed)&lt;BR /&gt;
&amp;gt;   (setq ed (entget (car (entsel))))&lt;BR /&gt;
&amp;gt;   (/ (cdr (assoc 41 ed)) (cdr (assoc 45 ed)))&lt;BR /&gt;
&amp;gt; )&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; This is possible because in AutoCAD2000, the data is no longer stored as&lt;BR /&gt;
XData.  For compatibility with existing LISP programs,&lt;BR /&gt;
&amp;gt; when you do an entget and ask for the XData, we use the actual data to&lt;BR /&gt;
make up the appropriate XData values to be returned by&lt;BR /&gt;
&amp;gt; entget.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Peter Farrell wrote:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Carefully worded answer, but not the scale of a viewport from paper&lt;BR /&gt;
space only.  This gives the scale of the active model space&lt;BR /&gt;
&amp;gt; &amp;gt; viewport&lt;BR /&gt;
&amp;gt; &amp;gt; or recently active viewport.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; 1. Out of curiosity where is this recently active viewport information&lt;BR /&gt;
stored.&lt;BR /&gt;
&amp;gt; &amp;gt; 2. is there an equally elegant means to acquire the scale of&lt;BR /&gt;
&amp;gt; &amp;gt; any viewport you pick *from paperspace only*.  Frank's answer&lt;BR /&gt;
&amp;gt; &amp;gt; was good, is there a better one?&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; P. Farrell&lt;BR /&gt;
&amp;gt;&lt;/ARTC&gt;</description>
      <pubDate>Thu, 28 Oct 1999 04:12:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/viewport-scale-from-paper-space-only/m-p/891323#M163420</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-10-28T04:12:28Z</dc:date>
    </item>
  </channel>
</rss>

