<?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: OLE get the UCS Screen Center Position in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10132180#M63408</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/593837"&gt;@ronjonp&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This might be more fitting:&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Similar to this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun this ()
  (mapcar 'setvar
	  '(LIMMIN LIMMAX)
	  (mapcar '(lambda (x) (reverse (cdr (reverse x))))
		  (mapcar 'getvar '(EXTMIN EXTMAX))
	  )
  )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;But real question is , where does OLE fit in to any of it?&amp;nbsp; I'm guessing the OP decided it's not worth replying&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;EDIT&lt;/STRONG&gt;&lt;/FONT&gt;: surprise, surprise .&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/vba/ole-get-the-ucs-screen-center-position/m-p/10131094" target="_self"&gt;Same topic but VBA&lt;/A&gt;&amp;nbsp; and more surprisingly i basically gave the same answer but was ignored anyway.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Mar 2021 05:22:43 GMT</pubDate>
    <dc:creator>pbejse</dc:creator>
    <dc:date>2021-03-05T05:22:43Z</dc:date>
    <item>
      <title>OLE get the UCS Screen Center Position</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10131087#M63405</link>
      <description>&lt;P&gt;Using OLE Object&lt;/P&gt;&lt;P&gt;Wich is the Path (Acad.Activedocumet....) to get the&amp;nbsp;UCS Screen Center Position ???&lt;/P&gt;&lt;P&gt;In the following picture&lt;/P&gt;&lt;P&gt;(202293.622,4258614.444,0.0000)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="J.jpg" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/888907i5C69DAFE90132C58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="J.jpg" alt="J.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; Thanks,&lt;/P&gt;&lt;P&gt;Gery&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 19:06:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10131087#M63405</guid>
      <dc:creator>GeryKnee</dc:creator>
      <dc:date>2021-03-04T19:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: OLE get the UCS Screen Center Position</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10131130#M63406</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2354030"&gt;@GeryKnee&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Using OLE Object&lt;/P&gt;
&lt;P&gt;Wich is the Path (Acad.Activedocumet....) to get the&amp;nbsp;UCS Screen Center Position ???&lt;/P&gt;
&lt;P&gt;In the following picture&lt;/P&gt;
&lt;P&gt;(202293.622,4258614.444,0.0000)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt; Thanks,&lt;/P&gt;
&lt;P&gt;Gery&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Center of screen within objects?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(mapcar (function (lambda (a b) (/ (+ a b) 2.))) (getvar "extmin") (getvar "extmax"))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or the center of OLE object?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun c:demo ( / obj pt)
       (if
	   (setq obj (car (entsel "\nSelect object: ")))
	 (progn
	 	(Vla-getboundingbox (vlax-ename-&amp;gt;vla-object obj) 'll 'ur)
	   	(setq pt (mapcar (function (lambda (a b) (/ (+ a b) 2.)))
			(vlax-safearray-&amp;gt;list ll)(vlax-safearray-&amp;gt;list ur)
			)
		      )
	    (sssetfirst nil (ssadd (entmakex (list (cons 0 "POINT")
                  		(cons 10 pt)))))
	   
	   )
	 )(princ)
  )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or even&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(getvar 'viewctr)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 04 Mar 2021 19:50:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10131130#M63406</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-03-04T19:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: OLE get the UCS Screen Center Position</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10132162#M63407</link>
      <description>&lt;P&gt;This might be more fitting:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(defun VPCords ( )
;; https://www.theswamp.org/index.php?topic=25589.msg307970#msg307970
    (   (lambda (offset)
            (   (lambda (viewctr)
                    (list
                        (mapcar '- viewctr offset)
                        (mapcar '+ viewctr offset)
                    )
                )
                (getvar "viewctr")
            )
        )
        (   (lambda (halfHeight aspectRatio)
                (list
                    (* halfHeight aspectRatio)
                    halfHeight
                )
            )
            (* 0.5 (getvar "viewsize"))
            (apply '/ (getvar "screensize"))
        )
    )
)
;; usage to get center of screen .. OLE where doe that come into play?
(mapcar '/ (mapcar '+ (car (vpcords)) (cadr (vpcords))) '(2 2 2))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 05:19:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10132162#M63407</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2021-03-05T05:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: OLE get the UCS Screen Center Position</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10132180#M63408</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/593837"&gt;@ronjonp&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This might be more fitting:&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Similar to this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun this ()
  (mapcar 'setvar
	  '(LIMMIN LIMMAX)
	  (mapcar '(lambda (x) (reverse (cdr (reverse x))))
		  (mapcar 'getvar '(EXTMIN EXTMAX))
	  )
  )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;But real question is , where does OLE fit in to any of it?&amp;nbsp; I'm guessing the OP decided it's not worth replying&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;EDIT&lt;/STRONG&gt;&lt;/FONT&gt;: surprise, surprise .&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/vba/ole-get-the-ucs-screen-center-position/m-p/10131094" target="_self"&gt;Same topic but VBA&lt;/A&gt;&amp;nbsp; and more surprisingly i basically gave the same answer but was ignored anyway.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 05:22:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10132180#M63408</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-03-05T05:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: OLE get the UCS Screen Center Position</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10132198#M63409</link>
      <description>&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;FWIW 'this' does not return the same numbers as vpcords. Not sure about the OLE part of this equation either.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun vpcords ()
  ((lambda (offset)
     ((lambda (viewctr) (list (mapcar '- viewctr offset) (mapcar '+ viewctr offset)))
       (getvar "viewctr")
     )
   )
    ((lambda (halfheight aspectratio) (list (* halfheight aspectratio) halfheight))
      (* 0.5 (getvar "viewsize"))
      (apply '/ (getvar "screensize"))
    )
  )
)
(grdraw '(0 0 0) (mapcar '/ (mapcar '+ (car (vpcords)) (cadr (vpcords))) '(2 2 2)) 1)
(defun this ()
  (mapcar 'setvar
	  '(limmin limmax)
	  (mapcar '(lambda (x) (reverse (cdr (reverse x)))) (mapcar 'getvar '(extmin extmax)))
  )
)
(grdraw '(0 0 0) (mapcar '/ (mapcar '+ (car (this)) (cadr (this))) '(2 2 2)) 2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&amp;nbsp;This is incorrect too ( for center of screen ) so I'm pretty sure the OP's question is lost in translation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(grdraw '(0 0 0) (mapcar '/ (getvar 'viewctr) '(2 2 2)) 1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Red (vpcords)&lt;BR /&gt;Green (this)&lt;/P&gt;&lt;P&gt;Yellow (getvar 'viewctr)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ronjonp_0-1614922921465.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/889081i1F4177B26137797A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ronjonp_0-1614922921465.png" alt="ronjonp_0-1614922921465.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 05:43:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10132198#M63409</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2021-03-05T05:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: OLE get the UCS Screen Center Position</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10132209#M63410</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/593837"&gt;@ronjonp&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;FWIW 'this' does not return the same numbers as vpcords. Not sure about the OLE part of this equation either.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Oh snap! You are right. (vpcords) also has nothing to do with the drawing entities.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 05:49:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10132209#M63410</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-03-05T05:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: OLE get the UCS Screen Center Position</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10137536#M63411</link>
      <description>&lt;P&gt;Maybe not, but it's fun to see two brainiacs going at it.&amp;nbsp; Just like the good ol' days on Compuserve.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 00:07:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10137536#M63411</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-03-08T00:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: OLE get the UCS Screen Center Position</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10137751#M63412</link>
      <description>&lt;P&gt;Thank you very match ronjonp.&lt;/P&gt;&lt;P&gt;Codes written in autolisp can be called from autocad ole object as I think (I’m not sure) using ActiveDocument.SendCommand method. Is calling Commands (lisp syndax defun c:MyCommand … that is a void procedure (doesn’r return exported values). How can I get the position (a pair of doubles)?? &amp;nbsp;ActiveDocument.SendCommand method doesn’t return any value. I have to find the acad ole object properties and methods in order to use them in &amp;nbsp;my Delphi code.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gery.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 03:13:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10137751#M63412</guid>
      <dc:creator>GeryKnee</dc:creator>
      <dc:date>2021-03-08T03:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: OLE get the UCS Screen Center Position</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10137755#M63413</link>
      <description>&lt;P&gt;Thank you very match pbejse.&lt;/P&gt;&lt;P&gt;Codes written in autolisp can be called from autocad ole object as I think (I’m not sure) using ActiveDocument.SendCommand method. Is calling Commands (lisp syndax defun c:MyCommand … that is a void procedure (doesn’r return exported values). How can I get the position (a pair of doubles)?? &amp;nbsp;ActiveDocument.SendCommand method doesn’t return any value. I have to find the acad ole object properties and methods in order to use them in &amp;nbsp;my Delphi code.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gery.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 03:17:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ole-get-the-ucs-screen-center-position/m-p/10137755#M63413</guid>
      <dc:creator>GeryKnee</dc:creator>
      <dc:date>2021-03-08T03:17:38Z</dc:date>
    </item>
  </channel>
</rss>

