Message 1 of 3
IV9: Moving a DrawingView in IDW files - my VBA doesn't work

Not applicable
09-08-2004
09:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I need to move the position of a drawing view (using VBA) before generating a DXF file from that IDW.
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!
Dim oDwgView as DrawingView
set oDwgView = oDrawingFile.ActiveSheet.DrawingViews.Item(1)
'This sets DwgView to refer to my desired view.
Dim Cent() as Double
oDwgView.Center.GetPointData Cent()
'Loads existing center coordinates into Array.
Cent(0) = 0 'Sets X-Coord to 0
Cent(1) = 0 'Sets Y-Coord to 0
msgbox Cent(0) & " " & Cent(1)
' Shows me that Cent array is (0,0)
DwgView.Center.PutPointData Cent()
oDrawingFile.Update
'This SHOULD move the view by resetting the center position
msgbox DwgView.Centre.X & " " & DwgView.Center.Y
'This shows that the center of the view HAS NOT CHANGED
What am I doing wrong?
Andrew
I need to move the position of a drawing view (using VBA) before generating a DXF file from that IDW.
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!
Dim oDwgView as DrawingView
set oDwgView = oDrawingFile.ActiveSheet.DrawingViews.Item(1)
'This sets DwgView to refer to my desired view.
Dim Cent() as Double
oDwgView.Center.GetPointData Cent()
'Loads existing center coordinates into Array.
Cent(0) = 0 'Sets X-Coord to 0
Cent(1) = 0 'Sets Y-Coord to 0
msgbox Cent(0) & " " & Cent(1)
' Shows me that Cent array is (0,0)
DwgView.Center.PutPointData Cent()
oDrawingFile.Update
'This SHOULD move the view by resetting the center position
msgbox DwgView.Centre.X & " " & DwgView.Center.Y
'This shows that the center of the view HAS NOT CHANGED
What am I doing wrong?
Andrew