Hi,
use the PLOT-command and prepare a PC3-file that's for creating raster-files. To create a PC3-file that's for writing JPGs (or some other raster-formats) use the PLOTTERMANAGER and "Add a new Plotter-Wizard"
- alfred -
i want convert dwg files to jpg with vb macro
Hi,
>> i want convert dwg files to jpg with vb macro
ok, yes, .... and imho plotting would be the option I would use for that. It solves a lot of problems like line-weights, linetype-scaling, ... it's independend from screen-resolution, ....
Why don't you like this way?
- alfred -
i use below code but slow run and output in 20 sec and second autocad open
you can try code
is there more easy method than
Public
SubPlot()
Dim ThisDrawing AsAcadDocument = acadapp.ActiveDocument
ThisDrawing.ActiveLayout.RefreshPlotDeviceInfo()
Dim Layouts As AcadLayouts, Layout AsAcadLayout
Dim msg AsStringDim ACADPref AsAcadPreferencesFiles
Dim originalValue AsObject' Get the files preferences object
ACADPref = ThisDrawing.Application.Preferences.Files
' Read and display the original value
originalValue = ACADPref.PrinterConfigPath
' Get Color Table Names
ThisDrawing.ActiveLayout.GetPlotStyleTableNames()
' Changes Color Table
ThisDrawing.ActiveLayout.StyleSheet =
"monochrome.ctb"' Get layouts collection from document object
Layouts = ThisDrawing.Layouts
ThisDrawing.Regen(AcRegenType.acAllViewports)
' mesage box check plot rotation correct if nessasry
GoToPLOT_DWF
ExitSub
PLOT_DWF:
ThisDrawing.ActiveLayout.ConfigName =
"PublishToWeb JPG.Pc3"
ThisDrawing.ActiveLayout.PlotRotation = AcPlotRotation.ac0degrees
ThisDrawing.ActiveLayout.PlotType = AcPlotType.acExtents
ThisDrawing.ActiveLayout.CenterPlot =
True
ThisDrawing.ActiveLayout.StandardScale = AcPlotScale.acScaleToFit
ThisDrawing.Regen(AcRegenType.acAllViewports)
ThisDrawing.Plot.PlotToFile(ThisDrawing.FullName &
".jpg")
Return
EndSub