<?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: Moving a DrawingView in IDW files - my VBA doesn't work in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/iv9-moving-a-drawingview-in-idw-files-my-vba-doesn-t-work/m-p/1129114#M165308</link>
    <description>Try this...

Sub MoveAllViewsToCenterIDW()

Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
Set oSheet = oDrawDoc.ActiveSheet

Dim oTG As TransientGeometry
Set oTG = ThisApplication.TransientGeometry

Dim oPoint As Point2d
Set oPoint = oTG.CreatePoint2d(oSheet.Width / 2, oSheet.height / 2)

Dim oView As DrawingView
For Each oView In oSheet.DrawingViews
    oView.Center = oPoint
Next oView

MsgBox "Done...now try to move them back ;-)", vbInformation

End Sub</description>
    <pubDate>Thu, 09 Sep 2004 07:36:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2004-09-09T07:36:29Z</dc:date>
    <item>
      <title>IV9: Moving a DrawingView in IDW files - my VBA doesn't work</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/iv9-moving-a-drawingview-in-idw-files-my-vba-doesn-t-work/m-p/1129113#M165307</link>
      <description>Hi All,&lt;BR /&gt;
&lt;BR /&gt;
I need to move the position of a drawing view (using VBA) before generating a DXF file from that IDW.&lt;BR /&gt;
&lt;BR /&gt;
Inventor's help tells me that DrawingView.Center can both set and get the center position of my view. I have tried to use this to move my view, but nothing happens!&lt;BR /&gt;
&lt;BR /&gt;
Dim oDwgView as DrawingView&lt;BR /&gt;
set oDwgView = oDrawingFile.ActiveSheet.DrawingViews.Item(1)&lt;BR /&gt;
'This sets DwgView to refer to my desired view.&lt;BR /&gt;
&lt;BR /&gt;
Dim Cent() as Double&lt;BR /&gt;
oDwgView.Center.GetPointData Cent()&lt;BR /&gt;
'Loads existing center coordinates into Array.&lt;BR /&gt;
&lt;BR /&gt;
Cent(0) = 0   'Sets X-Coord to 0&lt;BR /&gt;
Cent(1) = 0   'Sets Y-Coord to 0&lt;BR /&gt;
msgbox Cent(0) &amp;amp; " " &amp;amp; Cent(1) &lt;BR /&gt;
' Shows me that Cent array is (0,0)   &lt;BR /&gt;
&lt;BR /&gt;
DwgView.Center.PutPointData Cent()&lt;BR /&gt;
oDrawingFile.Update&lt;BR /&gt;
'This SHOULD move the view by resetting the center position&lt;BR /&gt;
&lt;BR /&gt;
msgbox DwgView.Centre.X &amp;amp; " " &amp;amp; DwgView.Center.Y&lt;BR /&gt;
'This shows that the center of the view HAS NOT CHANGED&lt;BR /&gt;
&lt;BR /&gt;
What am I doing wrong?&lt;BR /&gt;
&lt;BR /&gt;
Andrew</description>
      <pubDate>Thu, 09 Sep 2004 04:14:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/iv9-moving-a-drawingview-in-idw-files-my-vba-doesn-t-work/m-p/1129113#M165307</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-09-09T04:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Moving a DrawingView in IDW files - my VBA doesn't work</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/iv9-moving-a-drawingview-in-idw-files-my-vba-doesn-t-work/m-p/1129114#M165308</link>
      <description>Try this...

Sub MoveAllViewsToCenterIDW()

Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
Set oSheet = oDrawDoc.ActiveSheet

Dim oTG As TransientGeometry
Set oTG = ThisApplication.TransientGeometry

Dim oPoint As Point2d
Set oPoint = oTG.CreatePoint2d(oSheet.Width / 2, oSheet.height / 2)

Dim oView As DrawingView
For Each oView In oSheet.DrawingViews
    oView.Center = oPoint
Next oView

MsgBox "Done...now try to move them back ;-)", vbInformation

End Sub</description>
      <pubDate>Thu, 09 Sep 2004 07:36:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/iv9-moving-a-drawingview-in-idw-files-my-vba-doesn-t-work/m-p/1129114#M165308</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-09-09T07:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Moving a DrawingView in IDW files - my VBA doesn't work</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/iv9-moving-a-drawingview-in-idw-files-my-vba-doesn-t-work/m-p/5724276#M165309</link>
      <description>&lt;P&gt;Yea this helped,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim View As Inventor.DrawingView
For Each View In m_Sheet.DrawingViews
    View.Center = m_inventorApplication.TransientGeometry.CreatePoint2d(m_Sheet.Width / 2, m_Sheet.Height / 2)
    m_Sheet.Update()
Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 06:07:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/iv9-moving-a-drawingview-in-idw-files-my-vba-doesn-t-work/m-p/5724276#M165309</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-17T06:07:56Z</dc:date>
    </item>
  </channel>
</rss>

