Private Sub cmdOk_Click() Dim adText As AcadText Dim adMText As AcadMText Dim adSS As AcadSelectionSet Dim fType(0 To 1) As Integer, fData(0 To 1) Dim i As Integer Dim origin(0 To 1) As Double origin(0) = 10: origin(1) = 6 If lstfile.ListCount = 0 Then MsgBox "请添加所要打印的柱状图!" Exit Sub End If '打开图形进行操作 For i = 0 To lstfile.ListCount Application.Documents.Open lstfile.List(i) On Error Resume Next frmMain.Hide '创建新选择集 '开始打印 ZoomExtents ThisDrawing.ModelSpace.Layout.ConfigName = "HP LaserJet 5000 Series PCL6.pc3" ThisDrawing.ModelSpace.Layout.StyleSheet = "柱状图.ctb" ThisDrawing.ModelSpace.Layout.PaperUnits = acMillimeters ThisDrawing.ModelSpace.Layout.PlotOrigin = origin ThisDrawing.ModelSpace.Layout.CanonicalMediaName = "A4" ThisDrawing.ModelSpace.Layout.StandardScale = ac1_1 ThisDrawing.ModelSpace.Layout.PlotRotation = ac0degrees ThisDrawing.ModelSpace.Layout.PlotType = acExtents ThisDrawing.Regen acActiveViewport ThisDrawing.Plot.DisplayPlotPreview acFullPreview 'ThisDrawing.Plot.PlotToDevice '关闭图形 Application.ActiveDocument.Save 'Application.ActiveDocument.Close True, lstfile.List(i) Next i End Sub
在这儿ThisDrawing.ModelSpace.Layout.PaperUnits = acMillimeters我这儿我设置的图纸的尺寸以mm为单位了,也regen了,为什么实际上预览图纸的时候是以英寸为单位的呢?各位高手有谁也预见了同样的问题呢! |