我没有ARD2007,但ARD2006有一个ActiveX帮助文件。它没有真正的帮助,但有一些关于SaveAs和导出的示例。这是SaveAs:
- Sub Example_SaveAs()
-
- ' This example searches through all images in the Current Space and will prompt the
- ' user to save all images of the RLC type. This routine then uses a Save As call
- ' to save the image using the appropriate image file type. To test this routine,
- ' insert at least one RLC image.
-
- ' This calls a procedure to load Cad Overlay. All procedures that use Cad Overlay
- ' objects must ensure that Cad Overlay is currently loaded.
-
- EXLoadCadOverlay.Example_EXLoadCadOverlay
-
- ' Declare the necessary variables.
- Dim imID As Long ' The Object ID of the images.
- Dim imCurName As String ' The currently saved path and name of the image.
- Dim imNewName As String ' The new path and name for the image.
- Dim I, J As Integer ' For counting.
-
- ' Declare objects to utilize their respective classes.
- Dim coList As AecImageObjectList
- Dim coWrite As AecImageWrite
- Dim coFileName As AecCoImageInfo
-
- ' Set the objects to their respective classes.
- Set coList = ThisDrawing.Application.GetInterfaceObject("CADOverlay.AecImageObjectList")
- Set coWrite = ThisDrawing.Application.GetInterfaceObject("CADOverlay.AecImageWrite")
- Set coFileName = ThisDrawing.Application.GetInterfaceObject("CADOverlay.AecCoImageInfo")
-
- ' Search all images in the current space to determine if they are of type RLC. If they
- ' are, prompt the user to save that particular image. CurrentSpaceCount is 0 based; set
- ' I = 0 to CurrentSpaceCount -1. The Image Object ID is passed to the AecCoImageInfo
- ' object to retrieve the File Name and passed to the AecImageWrite object to write out
- ' the file with the Save As method.
-
- For I = 0 To coList.CurrentSpaceCount - 1
- imID = coList.CurrentSpaceObjectID(I)
- coWrite.ImageObjectID = imID
- coFileName.ImageObjectID = imID
- imCurName = coFileName.SavedImageFilePath
- If Right(coFileName.SavedImageFilePath, 3) = "rlc" Then
- J = J + 1
- If MsgBox("Save This Image?", vbYesNo, imCurName) = vbYes Then
- coWrite.Format = coRLC
- imNewName = "c:\Temp" & J & ".rlc"
- coWrite.SaveAs (imNewName)
- End If
- End If
- Next
-
- ' Formats supported for Save, Save As, and Export are BMP, RLE, DIB, CAL, GP4, RST, MIL,
- ' CG4, FLC, FLI, JPG, PCX, PNG, RLC (with IST header), TGA, TIF.
-
- End Sub
并且帮助确实记录了只需要一个引用:
|