hdslj 发表于 2005-10-8 22:06:00

帮忙看看这一点程序,关于打印的问题,有何不妥!

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

mccad 发表于 2005-10-9 06:32:00

<P>设置的是在页面设置对话框中显示的单位,而不是图形的单位。</P>

hdslj 发表于 2005-10-9 11:41:00

我指的就是图纸的尺寸!

lafare 发表于 2005-12-2 14:46:00

其实内部都是以毫米为单位的,只是显示的是英寸而矣,没事没事。
页: [1]
查看完整版本: 帮忙看看这一点程序,关于打印的问题,有何不妥!