Hi Guys I'm trying to put together a VBA macro/program to create a set of drgs with raster attachments using the raster image name as the dwg filename. There could be anything from 5 to 100 or so raster images that require 'attaching' to a .dwg file for ease of plotting. The problem arises when creating a PViewport (of a size equivalent to the raster image size) and then trying to save the .dwg. It is saved OK but the PViewport is not there on re-opening the dwg. The code used to create the PViewport is shown below. If AttachImage(imageFile) Then ZoomExtents imgSize = GetImageSize(imgWidth, imgHeight) If .ActiveSpace = acModelSpace Then .ActiveSpace = acPaperSpace End If Set Lay1 = .Layouts.Item("Layout1") Set Lay1 = .ActiveLayout Lay1.name = LayoutName(imgSize) .ActiveLayout.CanonicalMediaName = MediaSize(imgSize) For Each PView In .PaperSpace PView.Delete Next PView .Regen acActiveViewport LayerTest Pview_Centre(0) = imgWidth / 2 Pview_Centre(1) = imgHeight / 2 Pview_Centre(2) = 0 Set PView = .PaperSpace.AddPViewport(Pview_Centre, imgWidth, imgHeight) PView.Display True .MSpace = True ZoomExtents .MSpace = False PView.StandardScale = acVp1_1 PView.DisplayLocked = True intPos = InStr(1, strFName, ".", vbTextCompare) strFName = Left(strFName, intPos - 1) .SaveAs (strFilePath & strFName), ac2000_dwg End If Hope someone can help 'cos this is driving me nuts. BTW this all happens in SDI mode cheers PeteB