<?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: create viewport from rectangle or block in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10774059#M2905</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10483286"&gt;@angelinabrown0123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am sorry that I do not fully understand your request: my code posted in my blog is complete code. It is meant to show how to get the job of opening a viewport on layer based on a specified area in modelspace. But it is not specifically coded to work against your drawing attached in your original post. If you do have basic AutoCAD VBA knowledge, you can adapt the code with just minor changes for your use. To run the VBA code I wrote, you copy the code into a VBA project's module/class and off you go, as simple as that.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Nov 2021 16:18:03 GMT</pubDate>
    <dc:creator>Norman_Yuan</dc:creator>
    <dc:date>2021-11-22T16:18:03Z</dc:date>
    <item>
      <title>create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10734474#M2893</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;I want to make viewport from rectangle or block, have to keep the scale of viewport 0.5, I don't know if it is possible with VBA code. If it is possible with VBA code then help me to provide the code.&lt;/P&gt;&lt;P&gt;Thank in advance&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 05:48:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10734474#M2893</guid>
      <dc:creator>angelinabrown0123</dc:creator>
      <dc:date>2021-11-04T05:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10765375#M2894</link>
      <description>&lt;P&gt;consider viewport from block&lt;/P&gt;&lt;P&gt;assuming the block inserted in paperspace is in scale= 1&amp;nbsp; &amp;amp; roation =0 in paperspace&lt;/P&gt;&lt;P&gt;getboundingbox&lt;/P&gt;&lt;P&gt;addviewport&amp;nbsp; with center,width and height from getboundingbox&lt;/P&gt;&lt;P&gt;change space to mspace&lt;/P&gt;&lt;P&gt;get midpoint of block in the modelspace using getboundingbox&lt;/P&gt;&lt;P&gt;set veiwctr systemvariable with midpoint&lt;/P&gt;&lt;P&gt;rotate view according to angle of block in modelspace&lt;/P&gt;&lt;P&gt;scale the viewport relative to block in modelspace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i didnt try this,&lt;/P&gt;&lt;P&gt;i will try to code if i get time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;another option&lt;/P&gt;&lt;P&gt;insert block with same rotation as in the modelspace&lt;/P&gt;&lt;P&gt;then explode and clip the viewport with pline inside the exploded block&lt;/P&gt;&lt;P&gt;then rotate the viewport using sendcommand to the -angle&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 07:06:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10765375#M2894</guid>
      <dc:creator>MakCADD</dc:creator>
      <dc:date>2021-11-18T07:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10766031#M2895</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1265615"&gt;@MakCADD&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You have given very good logic but it is impossible for me to do it, however I am learning VBA right now if you can help me I will be very grateful to you please do it in your spare time I have no hurry&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 13:05:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10766031#M2895</guid>
      <dc:creator>angelinabrown0123</dc:creator>
      <dc:date>2021-11-18T13:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10766334#M2896</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10483286"&gt;@angelinabrown0123&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1265615"&gt;@MakCADD&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here below a link to a post made by EdJobe on the same topic&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/vba/get-the-coordinates-of-a-viewport/m-p/10731081#M105655" target="_blank"&gt;Solved: Re: GET THE COORDINATES OF A VIEWPORT - Autodesk Community - AutoCAD&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 14:58:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10766334#M2896</guid>
      <dc:creator>grobnik</dc:creator>
      <dc:date>2021-11-18T14:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10766429#M2897</link>
      <description>&lt;P&gt;While you can certainly write&amp;nbsp; your own code, the MVIEW command has this feature.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 15:31:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10766429#M2897</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2021-11-18T15:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10766436#M2898</link>
      <description>&lt;P&gt;It didn't add the screencast.&lt;/P&gt;
&lt;DIV id="14a829d1-c990-4205-8e6d-01fe553d6fe4" class="myscreencast-iframe iframe-container" style="display: none;"&gt;&lt;IFRAME width="640" height="620" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" data-src="https://screencast.autodesk.com/Embed/Timeline/14a829d1-c990-4205-8e6d-01fe553d6fe4"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;
&lt;DIV id="3aeed474-cea5-4cb7-8ba1-3e971d6cc9c6" class="myscreencast-iframe iframe-container active-myscreencast"&gt;&lt;IFRAME src="https://screencast.autodesk.com/Embed/Timeline/3aeed474-cea5-4cb7-8ba1-3e971d6cc9c6" width="640" height="650" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" data-src="https://screencast.autodesk.com/Embed/Timeline/3aeed474-cea5-4cb7-8ba1-3e971d6cc9c6"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 Nov 2021 15:33:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10766436#M2898</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2021-11-18T15:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10770515#M2899</link>
      <description>&lt;P&gt;Wouldn't it be better to use a ready-made solution?&lt;BR /&gt;Use the forum search, there are several options.&lt;BR /&gt;For example this - &lt;A href="https://www.kdmsoft.net/autoviewport.html" target="_blank" rel="noopener"&gt;AutoViewport&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 13:05:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10770515#M2899</guid>
      <dc:creator>maratovich</dc:creator>
      <dc:date>2021-11-20T13:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10770584#M2900</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1622231"&gt;@maratovich&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I am looking for VBA code, if I need software in future I will contact you.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 14:30:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10770584#M2900</guid>
      <dc:creator>angelinabrown0123</dc:creator>
      <dc:date>2021-11-20T14:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10772088#M2901</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10483286"&gt;@angelinabrown0123&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I heard your call for a code sample, but did not have time due to busy work until now. I wrote sample VBA code that works exactly as you expected, hopefully. Just for better readability, I post the code in my blog instead of here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://drive-cad-with-code.blogspot.com/2021/11/use-com-apivba-to-open-viewport-on.html" target="_blank" rel="noopener"&gt;https://drive-cad-with-code.blogspot.com/2021/11/use-com-apivba-to-open-viewport-on.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 16:54:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10772088#M2901</guid>
      <dc:creator>Norman_Yuan</dc:creator>
      <dc:date>2021-11-21T16:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10772413#M2902</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@Norman_Yuan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I saw the video and the code, I really liked it a lot but I'm having a little trouble calling it, although I don't know much VBA, can you please provide the calling code as well.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 23:23:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10772413#M2902</guid>
      <dc:creator>angelinabrown0123</dc:creator>
      <dc:date>2021-11-21T23:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10772894#M2903</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10483286"&gt;@angelinabrown0123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have two code versions, you have just look at link.&lt;/P&gt;&lt;P&gt;On 18th November I shared a link from EdJobe see:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/vba/get-the-coordinates-of-a-viewport/m-p/10731081#M105655" target="_blank"&gt;https://forums.autodesk.com/t5/vba/get-the-coordinates-of-a-viewport/m-p/10731081#M105655&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And yesterday Norman shared the link where code and video has been shared see&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive-cad-with-code.blogspot.com/2021/11/use-com-apivba-to-open-viewport-on.html" target="_blank"&gt;Drive AutoCAD with Code: Use COM API/VBA to Open Viewport on Layout to Show Given Content in ModelSpace (drive-cad-with-code.blogspot.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't tested both but for sure both will works fine for your application I guess.&lt;/P&gt;&lt;P&gt;If you will have some difficulties let us know in some way you will have the forum support.&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 07:17:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10772894#M2903</guid>
      <dc:creator>grobnik</dc:creator>
      <dc:date>2021-11-22T07:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10773837#M2904</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/472256"&gt;@grobnik&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first link code you provided places the viewport's frame into the model. and the second link code that &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@Norman_Yuan&lt;/a&gt; gave is correct but this code is divide into small functions that I don't fully understand, you know how to trigger it so you can make me "SUB()" that able to run the code.&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@Norman_Yuan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or I request&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@Norman_Yuan&lt;/a&gt; to give me the complete code as shown in the video.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you will give me the code.&lt;/P&gt;&lt;P&gt;Thank in advanced&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 15:02:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10773837#M2904</guid>
      <dc:creator>angelinabrown0123</dc:creator>
      <dc:date>2021-11-22T15:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10774059#M2905</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10483286"&gt;@angelinabrown0123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am sorry that I do not fully understand your request: my code posted in my blog is complete code. It is meant to show how to get the job of opening a viewport on layer based on a specified area in modelspace. But it is not specifically coded to work against your drawing attached in your original post. If you do have basic AutoCAD VBA knowledge, you can adapt the code with just minor changes for your use. To run the VBA code I wrote, you copy the code into a VBA project's module/class and off you go, as simple as that.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 16:18:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10774059#M2905</guid>
      <dc:creator>Norman_Yuan</dc:creator>
      <dc:date>2021-11-22T16:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10774334#M2906</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@Norman_Yuan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have called "&lt;STRONG&gt;Sub&amp;nbsp;OpenPVport()&lt;/STRONG&gt;" in the video, also took a screenshot of the video as shown in the image below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Video Screenshot" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/992397iAEB1E88FCFAC6E3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Video Screenshot.jpg" alt="Video Screenshot" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Video Screenshot&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the "&lt;STRONG&gt;OpenPVport()&lt;/STRONG&gt;" code in the second image is not visible anywhere on your site.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OpenPVport.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/992399i54844CCE60F2CED9/image-size/large?v=v2&amp;amp;px=999" role="button" title="OpenPVport.png" alt="OpenPVport.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 18:16:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10774334#M2906</guid>
      <dc:creator>angelinabrown0123</dc:creator>
      <dc:date>2021-11-22T18:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10774425#M2907</link>
      <description>&lt;P&gt;Oops, I am terribly sorry that I posted duplicated class "BorderBlock" and missed the macro "OpenPVport". Thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10483286"&gt;@angelinabrown0123&lt;/a&gt;&amp;nbsp;pointed it out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The the code in my article has been updated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 18:57:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10774425#M2907</guid>
      <dc:creator>Norman_Yuan</dc:creator>
      <dc:date>2021-11-22T18:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10774611#M2908</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10483286"&gt;@angelinabrown0123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess this can help you more see attached zip containing dvb file project already separated the class definition section and VBA section.&lt;/P&gt;&lt;P&gt;As second issue the Viewport border on ModelSpace shall be a block called as "VPORT_BOUNDARY", if not you have to change the block name into the proceudere.&lt;/P&gt;&lt;P&gt;And the active layout name is defined into procedure as "Layout1" if not you have to change the name into procedure.&lt;/P&gt;&lt;PRE&gt;ThisDrawing.ActiveLayout = ThisDrawing.Layouts("Layout1")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I tested and seems to work even if I have some other issue with the scale, I'll investigate more, in case I'll ask to&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@Norman_Yuan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 20:12:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10774611#M2908</guid>
      <dc:creator>grobnik</dc:creator>
      <dc:date>2021-11-22T20:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10774706#M2909</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@Norman_Yuan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi Norman, I would like to thank you very much for useful code. It's working perfectly.&lt;/P&gt;&lt;P&gt;If you can help us a litte bit more:&lt;/P&gt;&lt;P&gt;I have some issue with centering the ModelSpace border selected into viewport on Layout. Both has the same size A3.&lt;/P&gt;&lt;P&gt;I saw a section in the code concerning the position (angle, corner, etc.), but I have some difficulties to understand.&lt;/P&gt;&lt;P&gt;I already have a drawing title block the same on several layout, a company form A3 size with logo, and i have some issue with centering the bored block with drawing title block. Could you spent some additional time to help me fixing this issue ?.&lt;/P&gt;&lt;P&gt;I already fixed the scale setting to 1 instead 0,05 as your code indicated I'll prepare an example and I'll share with you for better understanding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 20:52:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10774706#M2909</guid>
      <dc:creator>grobnik</dc:creator>
      <dc:date>2021-11-22T20:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10774978#M2910</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@Norman_Yuan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now it's perfect, actually you made great code, it will be very helpful for me, &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@Norman_Yuan&lt;/a&gt;&amp;nbsp; thank you very much for giving the code and updating it&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;.&lt;BR /&gt;And many thanks to everyone involved in this forum, I'll try it for the rectangle as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 23:22:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10774978#M2910</guid>
      <dc:creator>angelinabrown0123</dc:creator>
      <dc:date>2021-11-22T23:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10775100#M2911</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@Norman_Yuan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested your code with attached drawing of &lt;STRONG&gt;Post No.1&lt;/STRONG&gt; it generates viewport but does not take selected block in center you can check in gif.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Videoshoot" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/992535i2742A25BEB206567/image-size/large?v=v2&amp;amp;px=999" role="button" title="Videoshoot.gif" alt="Videoshoot" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Videoshoot&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 00:43:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10775100#M2911</guid>
      <dc:creator>angelinabrown0123</dc:creator>
      <dc:date>2021-11-23T00:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: create viewport from rectangle or block</title>
      <link>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10776534#M2912</link>
      <description>&lt;P&gt;It is difficult to say without having the drawing to play and without knowing what code change you have made (or not made). It seems to me, though, the corners' coordinates used for ZoomWindow() call may not be correct. Have you tried to verify the coordinates of the corners in debugging?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can add following 2 lines of code right before ZoomWindow [llcorner], [urcorner]:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;debug.Print border.LLCorner(0) &amp;amp; ", " &amp;amp; borderLLCorner(1)&lt;/P&gt;
&lt;P&gt;debug.Print border.URCorner(0) &amp;amp; ", " &amp;amp; borderURCorner(1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Seeing what the coordinates are, then go to ModelSpace to verify the corner positions of the selected border block.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 14:35:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/create-viewport-from-rectangle-or-block/m-p/10776534#M2912</guid>
      <dc:creator>Norman_Yuan</dc:creator>
      <dc:date>2021-11-23T14:35:20Z</dc:date>
    </item>
  </channel>
</rss>

