<?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 view position or center error value in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11376423#M141720</link>
    <description>&lt;P&gt;Does the same problem with the view position occur even without the crop? That is: it is not necessary to have a cropped view to reproduce the problem?&lt;/P&gt;</description>
    <pubDate>Tue, 23 Aug 2022 18:10:20 GMT</pubDate>
    <dc:creator>MjDeck</dc:creator>
    <dc:date>2022-08-23T18:10:20Z</dc:date>
    <item>
      <title>Set view position or center error value</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/10016730#M120189</link>
      <description>&lt;P&gt;Hi, I have an old code to control views positions. All was working as expected few months ago I guess.&lt;/P&gt;
&lt;P&gt;It work for front or side views, with a little lack of precision.&lt;/P&gt;
&lt;P&gt;It doesn't work for orthographic and perspective views.&lt;/P&gt;
&lt;P&gt;It doesn't seem to work anymore &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@3E5F6F5F61A59A319E954F4832B72305/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt;&lt;/P&gt;
&lt;P&gt;I'm using IV2021.2&lt;/P&gt;
&lt;P&gt;Here some examples codes to center a view on a sheet. Each command are producing some random results :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/869193iB5BF4CF7C26BFB6E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN style="color: #b2b2b5;"&gt;'SetCenter command&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Pick&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;SelectionFilterEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kDrawingViewFilter&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Select a view :"&lt;/SPAN&gt;).&lt;SPAN style="color: #db9652;"&gt;Name&lt;/SPAN&gt;
&lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;View&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt;).&lt;SPAN style="color: #9d6bce;"&gt;SetCenter&lt;/SPAN&gt;(&lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Width&lt;/SPAN&gt; / 2, &lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Height&lt;/SPAN&gt; / 2)
&lt;SPAN style="color: #db9652;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"ActiveSheet.View(oView).SetCenter()"&lt;/SPAN&gt; _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"View center X : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;View&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt;).&lt;SPAN style="color: #9d6bce;"&gt;Center&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;X&lt;/SPAN&gt; _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"View center Y : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;View&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt;).&lt;SPAN style="color: #9d6bce;"&gt;Center&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Y&lt;/SPAN&gt; _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"Sheet center X : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Width&lt;/SPAN&gt;/2 _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"Sheet center Y : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Height&lt;/SPAN&gt;/2 , &lt;SPAN style="color: #35b173;"&gt;"iLogic"&lt;/SPAN&gt;)&lt;/PRE&gt;
&lt;PRE&gt;&lt;SPAN style="color: #b2b2b5;"&gt;'SetSpacingToCorner&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Pick&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;SelectionFilterEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kDrawingViewFilter&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Select a view :"&lt;/SPAN&gt;).&lt;SPAN style="color: #db9652;"&gt;Name&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;CornerX&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;CornerY&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Decimal&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;CornerX&lt;/SPAN&gt; = (&lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Width&lt;/SPAN&gt; - &lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;View&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt;).&lt;SPAN style="color: #9d6bce;"&gt;Width&lt;/SPAN&gt;)/2
&lt;SPAN style="color: #db9652;"&gt;CornerY&lt;/SPAN&gt; = (&lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Height&lt;/SPAN&gt; - &lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;View&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt;).&lt;SPAN style="color: #9d6bce;"&gt;Height&lt;/SPAN&gt;)/2
&lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;View&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt;).&lt;SPAN style="color: #9d6bce;"&gt;SetSpacingToCorner&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;CornerX&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;CornerY&lt;/SPAN&gt;, &lt;SPAN style="color: #9d6bce;"&gt;SheetCorner&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;TopLeft&lt;/SPAN&gt;)
&lt;SPAN style="color: #db9652;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"ActiveSheet.View(oView).SetCenter()"&lt;/SPAN&gt; _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"View center X : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;View&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt;).&lt;SPAN style="color: #9d6bce;"&gt;Center&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;X&lt;/SPAN&gt; _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"View center Y : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;View&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt;).&lt;SPAN style="color: #9d6bce;"&gt;Center&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Y&lt;/SPAN&gt; _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"Sheet center X : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Width&lt;/SPAN&gt;/2 _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"Sheet center Y : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #9d6bce;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Height&lt;/SPAN&gt;/2 , &lt;SPAN style="color: #35b173;"&gt;"iLogic"&lt;/SPAN&gt;)
&lt;/PRE&gt;
&lt;PRE&gt;&lt;SPAN style="color: #b2b2b5;"&gt;'oBaseView.Position&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;oDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisDrawing&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oSheet&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;oSheet&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ActiveSheet&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oBaseView&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;DrawingView&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;oBaseView&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Pick&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;SelectionFilterEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kDrawingViewFilter&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Select a view :"&lt;/SPAN&gt;)
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;oBaseView&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Name&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oTG&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;TransientGeometry&lt;/SPAN&gt; 
&lt;SPAN style="color: #db9652;"&gt;oTG&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;TransientGeometry&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oOriginPoint&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Point2d&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;oOriginPoint&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreatePoint2d&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Width&lt;/SPAN&gt;/2, &lt;SPAN style="color: #db9652;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Height&lt;/SPAN&gt;/2)
&lt;SPAN style="color: #db9652;"&gt;oBaseView&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Position&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;oOriginPoint&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"oBaseView.Position"&lt;/SPAN&gt; _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"View center X : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;oBaseView&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Center&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;X&lt;/SPAN&gt;*10 _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"View center Y : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;oBaseView&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Center&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Y&lt;/SPAN&gt;*10 _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"Sheet center X : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Width&lt;/SPAN&gt;/2*10 _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"Sheet center Y : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Height&lt;/SPAN&gt; / 2*10, &lt;SPAN style="color: #35b173;"&gt;"iLogic"&lt;/SPAN&gt;)
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN style="color: #b2b2b5;"&gt;'oBaseView.Center&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;oDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisDrawing&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oSheet&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;oSheet&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ActiveSheet&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oBaseView&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;DrawingView&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;oBaseView&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Pick&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;SelectionFilterEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kDrawingViewFilter&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Select a view :"&lt;/SPAN&gt;)
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;oViewName&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;oBaseView&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Name&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oTG&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;TransientGeometry&lt;/SPAN&gt; 
&lt;SPAN style="color: #db9652;"&gt;oTG&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;TransientGeometry&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;oOriginPoint&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Point2d&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;oOriginPoint&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreatePoint2d&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Width&lt;/SPAN&gt;/2, &lt;SPAN style="color: #db9652;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Height&lt;/SPAN&gt;/2)
&lt;SPAN style="color: #db9652;"&gt;oBaseView&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Center&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;oOriginPoint&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"oBaseView.Center"&lt;/SPAN&gt; _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"View center X : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;oBaseView&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Center&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;X&lt;/SPAN&gt;*10 _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"View center Y : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;oBaseView&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Center&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Y&lt;/SPAN&gt;*10 _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"Sheet center X : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Width&lt;/SPAN&gt;/2*10 _
&amp;amp; &lt;SPAN style="color: #db9652;"&gt;vbNewLine&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #35b173;"&gt;"Sheet center Y : "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Height&lt;/SPAN&gt; / 2*10, &lt;SPAN style="color: #35b173;"&gt;"iLogic"&lt;/SPAN&gt;)
&lt;/PRE&gt;
&lt;P&gt;Can you reproduce this ?&lt;/P&gt;
&lt;P&gt;Any ideas ?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 17:08:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/10016730#M120189</guid>
      <dc:creator>ThomasB44</dc:creator>
      <dc:date>2021-01-20T17:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Set view position or center error value</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/10112945#M121376</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3343209"&gt;@ThomasB44&lt;/a&gt;&amp;nbsp;, there does seem to be a problem. I'll look into it further.&lt;BR /&gt;Here's a way to work around it:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;set the center once&lt;/LI&gt;
&lt;LI&gt;read the new center value back from the view : the achieved center point might not be what we asked for.&lt;/LI&gt;
&lt;LI&gt;adjust our desired center point by the difference between the really desired and achieved&lt;/LI&gt;
&lt;LI&gt;set the view center to that new new adjusted point. The system will adjust it again, thus giving us what we asked for originally!&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Here's code. This can replace your SetCenter rule.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim viewX As DrawingView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select a view :")
Dim sheetX = viewX.Parent
Dim sheetCenter = ThisApplication.TransientGeometry.CreatePoint2d(sheetX.Width / 2, sheetX.Height / 2)
Dim pointWanted = sheetCenter.Copy()
viewX.Center = pointWanted
Dim pointAchieved = viewX.Center
Dim diff = pointAchieved.VectorTo(sheetCenter)
Logger.Info("diff 1 = {0}, {1}", diff.X, diff.Y)
pointWanted.TranslateBy(diff)
viewX.Center = pointWanted
Dim pointAchieved2 = viewX.Center
Dim diff2 = pointAchieved2.VectorTo(sheetCenter)
Logger.Info("diff 2 = {0}, {1}", diff2.X, diff2.Y)
&lt;/LI-CODE&gt;
&lt;P&gt;(This uses the iLogic Log window instead of a message box. This window (or rather pane) can be made visible on the View &amp;gt; Windows &amp;gt; User Interface dropdown.)&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 02:48:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/10112945#M121376</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2021-02-26T02:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Set view position or center error value</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/10118762#M121459</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3343209"&gt;@ThomasB44&lt;/a&gt;&amp;nbsp;, it looks like this problem only happens with perspective views. Do you see it happening with an orthographic view? If you do, can you post a sample drawing?&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 18:17:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/10118762#M121459</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2021-02-28T18:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set view position or center error value</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/10120716#M121500</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/537534"&gt;@MjDeck&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your code, it works.&lt;/P&gt;
&lt;P&gt;I've done a repair of Microsoft Visual C++, it seems to correct some things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can see the problem happening with an orthographic view, if I set view size bigger than the sheet. But only with the command :&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN style="color: #35b173;"&gt;ActiveSheet.View(oView).SetSpacingToCorner()&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/887015i91258793BCC50E34/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You will find an example here attached.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 14:43:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/10120716#M121500</guid>
      <dc:creator>ThomasB44</dc:creator>
      <dc:date>2021-03-01T14:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Set view position or center error value</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/10125533#M121598</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3343209"&gt;@ThomasB44&lt;/a&gt;&amp;nbsp;, this is not the same defect. SetSpacingToCorner is designed to try to place the view within the sheet. It won't work with negative offsets.&lt;BR /&gt;If you need to center a view that's bigger than the sheet, it's best to set the center point directly.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 04:23:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/10125533#M121598</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2021-03-03T04:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set view position or center error value</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11367022#M141544</link>
      <description>&lt;P&gt;Are there any updates on this bug?&lt;/P&gt;&lt;P&gt;I can confirm that it's not only with perspective views.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;During drawing automation, a view on my drawing keeps getting moved, while the Position property stays the same (but the Center property changes).&lt;/P&gt;&lt;P&gt;This happens even though the bounding box of the view doesn't change, and also the center of the view (according to the center point of the model) doesn't change.&lt;/P&gt;&lt;P&gt;So that's strange, but I accepted it and wanted to move it back, but then I ran into this bug and the workaround fixes it.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 14:38:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11367022#M141544</guid>
      <dc:creator>Majjek</dc:creator>
      <dc:date>2022-08-18T14:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set view position or center error value</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11367044#M141546</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2773587"&gt;@Majjek&lt;/a&gt;&amp;nbsp;, can you post a sample drawing? Or provide more details about the rules you're using and your workflow?&lt;BR /&gt;Which version of Inventor are you using?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 14:47:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11367044#M141546</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2022-08-18T14:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Set view position or center error value</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11368238#M141561</link>
      <description>&lt;P&gt;Unfortunately I'm not able to send a sample drawing, it's quite a large model and confidential.&lt;/P&gt;&lt;P&gt;But I can explain the workflow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The involved drawing (actually drawings, there are about 25 similar drawings with this issue) is sort of a template drawing. The model assembly used in the drawing consists of multiple components overlapping.&lt;/P&gt;&lt;P&gt;On the drawing, we set parameters defining a configuration.&lt;/P&gt;&lt;P&gt;Then we've created an iLogic rule, which turns the visibility on/off for the components in the assembly according to the parameters, and then updates the views on the drawing (no new annotations are made).&lt;/P&gt;&lt;P&gt;The bounding box of some of the views will change, because of the size of some components, but all views remain on their locations.&lt;/P&gt;&lt;P&gt;The one problematic view is a section view with a crop, the crop is fully constrained (also tried without the crop).&lt;/P&gt;&lt;P&gt;Due to the crop, the outer dimensions of the view don't change and also the part of the model shown is exactly the same, but the view moves a bit on the drawing for some reason.&lt;/P&gt;&lt;P&gt;I can't explain why, but I accepted the fact that it moves, so the easiest thing to do is reposition the view afterwards.&lt;/P&gt;&lt;P&gt;So before anything is changed, I store the Center property in a variable.&lt;/P&gt;&lt;P&gt;Then the visibility will get switched, causing the view to move.&lt;/P&gt;&lt;P&gt;Then I reposition the center of the view back to the stored location.&lt;/P&gt;&lt;P&gt;It does move, but not to the correct position.&lt;/P&gt;&lt;P&gt;Then I use the code above to translate it again, using the difference.&lt;/P&gt;&lt;P&gt;Now the view is in the same location again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the results from looking up the Center and Position property of the view, before moving (Start), after the visibility change, after the first reposition and the final position after the correction.&lt;/P&gt;&lt;P&gt;You can see that after the view has moved due to the visibility, then Position is still the same, but the center has changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Center X&lt;/TD&gt;&lt;TD&gt;Center Y&lt;/TD&gt;&lt;TD&gt;Position X&lt;/TD&gt;&lt;TD&gt;Position Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Start&lt;/TD&gt;&lt;TD&gt;16,73628161&lt;/TD&gt;&lt;TD&gt;4,544619298&lt;/TD&gt;&lt;TD&gt;17,05079469&lt;/TD&gt;&lt;TD&gt;4,566641091&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Before reposition&lt;/TD&gt;&lt;TD&gt;17,22016003&lt;/TD&gt;&lt;TD&gt;4,541820581&lt;/TD&gt;&lt;TD&gt;17,05079469&lt;/TD&gt;&lt;TD&gt;4,566641091&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;After first reposition&lt;/TD&gt;&lt;TD&gt;16,90564695&lt;/TD&gt;&lt;TD&gt;4,519798788&lt;/TD&gt;&lt;TD&gt;16,73628161&lt;/TD&gt;&lt;TD&gt;4,544619298&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Final&lt;/TD&gt;&lt;TD&gt;16,73628161&lt;/TD&gt;&lt;TD&gt;4,544619298&lt;/TD&gt;&lt;TD&gt;16,56691626&lt;/TD&gt;&lt;TD&gt;4,569439808&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the view before and after, so exactly the same boundaries. The components didn't move in relation to the center point of the model:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Majjek_0-1660889807386.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1105639i464F8F0DEBDC3D47/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Majjek_0-1660889807386.png" alt="Majjek_0-1660889807386.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Majjek_1-1660889817546.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1105640iA3FC6E4815654455/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Majjek_1-1660889817546.png" alt="Majjek_1-1660889817546.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 06:21:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11368238#M141561</guid>
      <dc:creator>Majjek</dc:creator>
      <dc:date>2022-08-19T06:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set view position or center error value</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11374039#M141656</link>
      <description>&lt;P&gt;You said that:&lt;BR /&gt;"The one problematic view is a section view with a crop, the crop is fully constrained (also tried without the crop)."&lt;BR /&gt;Does the same problem occur when the view is uncropped?&lt;BR /&gt;Is the crop a drawing sketch, constrained to model geometry?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 19:12:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11374039#M141656</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2022-08-22T19:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set view position or center error value</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11374846#M141668</link>
      <description>&lt;P&gt;It's in the line you've quoted between parentheses&amp;nbsp;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;.&lt;/P&gt;&lt;P&gt;I've also tried it without the crop, so uncropped.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The crop sketch is the default rectangle from a default crop, but it's constrained to the model geometry.&lt;/P&gt;&lt;P&gt;After the view is modified, all the model geometry is still available.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 06:13:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11374846#M141668</guid>
      <dc:creator>Majjek</dc:creator>
      <dc:date>2022-08-23T06:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set view position or center error value</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11376423#M141720</link>
      <description>&lt;P&gt;Does the same problem with the view position occur even without the crop? That is: it is not necessary to have a cropped view to reproduce the problem?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 18:10:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11376423#M141720</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2022-08-23T18:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set view position or center error value</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11379795#M141770</link>
      <description>&lt;P&gt;That's what I said, it doesn't matter if the view is cropped or not, the problem persists.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 05:24:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/set-view-position-or-center-error-value/m-p/11379795#M141770</guid>
      <dc:creator>Majjek</dc:creator>
      <dc:date>2022-08-25T05:24:08Z</dc:date>
    </item>
  </channel>
</rss>

