|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
下面代码中,如果使用PLOTTODEVICE方法,是可以打印成功的,但是需要手动输入文件名, l# c) c* S+ y) I" s; ~2 \
4 J5 |+ K) Q0 ?3 _, j- c3 w( |* W' b
我想让程序中自动输出文件名,所以使用了plottofile方法,结果却无法正确输出了,输出的PDF文件打不开
$ t' h3 o8 C, M- g+ l+ c% f0 ]5 z# {2 N9 f% l
代码如下,请大虾指点,谢谢
7 A: |( R7 N8 k& S) n7 J, f- M* z4 [3 v
-
7 B4 L I: m+ L: e* E - ThisDrawing.ModelSpace.Layout.RefreshPlotDeviceInfo '刷新打印设备信息 N, w/ S _ `# U1 A
- ThisDrawing.ModelSpace.Layout.ConfigName = "Adobe PDF" '设置打印机为虚拟打印机 Microsoft Office Document Image Writer4 ^% b7 t9 h) m4 X2 L- n) C
- ThisDrawing.ModelSpace.Layout.CanonicalMediaName = "A3" '设置纸型为A3' [* {* A% ^, S5 O' f1 Q: i
- ' RegOpenKeyEx HKEY_CURRENT_USER, regpath, 0, KEY_ALL_ACCESS, Result9 U& r- [( i9 v. Y& e7 t3 J
- ' RegSetValueEx Result, "OpenInMODI", 0, reg_dword, 0, 48 G' E0 C4 ?9 H
- ' RegCloseKey Result* h7 I# S0 c6 h2 M1 \
- Dim point1(0 To 1) As Double, point2(0 To 1) As Double0 O. K. V9 T* g" @1 e: \) g/ A: l1 r
- Dim path11 As String; h2 X: E. @0 E y k8 M/ o$ J( s
- path11 = "D:\123.pdf"* \4 a+ }" n' u/ ^" X2 c
- Scal = 39: D7 x# S6 W+ h! `# v z7 F7 z
- point1(0) = 0 '安装图1
# [6 x' X( X' u& e2 | - point1(1) = 0
4 T, [5 a& H+ e% | V6 _: w6 p - point2(0) = 420 * Scal
: R* h p5 x5 Q! k) E( ^ - point2(1) = 297 * Scal
% B& W; f7 ~ r q% S& e; m7 {- r" X - ThisDrawing.ActiveLayout.SetWindowToPlot point1(), point2()
$ {5 @. S- e1 u - ThisDrawing.ActiveLayout.GetWindowToPlot point1(), point2(); x7 M. n* s! f0 x
- ThisDrawing.ModelSpace.Layout.PlotRotation = ac90degrees
5 J& _0 H- u) o3 P& ? - ThisDrawing.Regen acActiveViewport8 f# v1 ?% g) b+ J6 \; w0 s* L! v
- ThisDrawing.Plot.NumberOfCopies = 1* q0 d) k7 r' a+ C5 L
- ThisDrawing.ModelSpace.Layout.PlotType = acWindow
l- s' P, F9 @3 _5 W - ThisDrawing.ModelSpace.Layout.StandardScale = acVpScaleToFit! \$ F' G6 Z8 R' Q O
- ThisDrawing.ModelSpace.Layout.CenterPlot = True
1 d' X1 f2 W% Z( S - ThisDrawing.Plot.QuietErrorMode = True
# b' \$ G% Y8 o Y( \- n -
# U/ @5 F( x! P: W! B R# `% W - ) _9 Q: S, f8 H( q. v
- ' RegOpenKeyEx HKEY_CURRENT_USER, regpath, 0, KEY_ALL_ACCESS, Result N. \1 k. \* r4 E4 ]* ]
- ' RegSetValueEx Result, "OpenInMODI", 0, reg_dword, 0, 4
! \ _8 ]# H& U; l5 y# f! { - ' RegCloseKey Result
0 W6 i7 N. s* l9 F) Z2 _/ a - ThisDrawing.Plot.PlotToFile path11
% m+ ^4 _/ b) g: x2 k -
, P9 t( Y+ a& I) j, R- z
复制代码 |
|