明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1196|回复: 0

菜鸟请大家帮忙解决个vba打印的问题

[复制链接]
发表于 2010-6-2 23:45:00 | 显示全部楼层 |阅读模式

这个是vba的一个实例,但是我在打印预览的时候看不到任何东西!

Sub Example_GetWindowToPlot()
    ' This example allows the user to define an area in the current layout to plot
    ' and displays a plot preview of the defined area.
    '
    ' * Note: You will have to exit the
    ' plot preview before the VBA example will stop and control will be returned
   
    Dim point1 As Variant, point2 As Variant
   
    ' Get first point in window
    point1 = ThisDrawing.Utility.GetPoint(, "Click the lower-left of the window to plot.")
    ReDim Preserve point1(0 To 1)   ' Change this to a 2D array by removing the Z position
   
    ' Get second point in window
    point2 = ThisDrawing.Utility.GetPoint(, "Click the upper-right of the window to plot.")
    ReDim Preserve point2(0 To 1)   ' Change this to a 2D array by removing the Z position
   
    ' Send information about window to current layout
    ThisDrawing.ActiveLayout.SetWindowToPlot point1, point2
   
    ' Read back window information
    ThisDrawing.ActiveLayout.GetWindowToPlot point1, point2
   
    MsgBox "Press any key to plot the following window:" & vbCrLf & vbCrLf & _
           "Lower Left: " & point1(0) & ", " & point1(1) & vbCrLf & _
           "Upper Right: " & point2(0) & ", " & point2(1)
   
    ' Make sure the instruction is to plot a view, not some other plot style
    ThisDrawing.ActiveLayout.PlotType = acWindow
   
    ' Send Plot To Window
    ThisDrawing.Plot.DisplayPlotPreview acFullPreview
End Sub

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-25 23:01 , Processed in 0.151002 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表