Joro-- 发表于 2008-5-11 12:44:53

在. jpg中绘制

嗨,
我不确定VBA是否可能,但我需要的是能够打印到绘图的自定义区域.jpg并将文件保存在c:\上。如果可能的话,如果我能指定分辨率和情节风格(彩色或黑白)就好了.....
任何人都可以帮忙吗?
**** Hidden Message *****

Joro-- 发表于 2008-5-11 12:50:00

我有密码,但是在办公室里。明天我会寄出去

Joro-- 发表于 2008-5-12 06:23:42

好的,谢谢!

Joro-- 发表于 2008-5-12 14:23:19

以下是代码
Public Sub PrintToJPG()
      Dim Layout As AcadLayout
      On Error GoTo Err_Control
      Set Layout = ThisDrawing.ActiveLayout
      Layout.RefreshPlotDeviceInfo
      Layout.ConfigName = "JPG.pc3"' You need to call your PC3 you created to print to jpg here
      Layout.PlotType = acExtents
      Layout.PlotRotation = ac0degrees
      Layout.StyleSheet = "CTB.ctb"' Add your ctb or stb file here
      Layout.PlotWithPlotStyles = True
      Layout.PlotViewportBorders = False
      Layout.PlotViewportsFirst = True
       Layout.CanonicalMediaName = "UserDefinedRaster (10800.00 x 7200.00Pixels)"'Set your paper size here
      Layout.PaperUnits = acPixels
      Layout.SetCustomScale 300, 1'Add your scale factor based on the sheet size and resolution here
      Layout.ShowPlotStyles = False
      ThisDrawing.Plot.NumberOfCopies = 1
      Layout.CenterPlot = True
      Layout.ScaleLineweights = False
      ThisDrawing.Regen acAllViewports
      ZoomExtents
      strDrawingName = (Left(ThisDrawing.Name, (Len(ThisDrawing.Name) - 4)))
      Set Layout = Nothing
      ThisDrawing.Plot.PlotToFilestrDrawingName
Exit_Here:
      Exit Sub
Err_Control:
End Sub

Joro-- 发表于 2008-5-13 09:25:57

您好,CmdrDuh,
我尝试了该代码,它成功了。非常感谢
但我如何控制要打印布局的哪一部分?如何将绘制区域设置为具有给定的PtLowLeft(2)和PtHighRight(2),以便可以同时执行多个不同的绘制?

Joro-- 发表于 2008-5-13 10:06:17

您需要选择所需的2点,然后更改为acWindow。 我会看看我是否有一个片段显示

Joro-- 发表于 2008-5-13 10:15:45

从帮助文件中
页: [1]
查看完整版本: 在. jpg中绘制