jpgout with vb

jpgout with vb

Anonymous
Not applicable
514 Views
4 Replies
Message 1 of 5

jpgout with vb

Anonymous
Not applicable

Hello

i want to convert active dwg file  to jpg  file

how to do ?

 

0 Likes
515 Views
4 Replies
Replies (4)
Message 2 of 5

Alfred.NESWADBA
Consultant
Consultant

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 -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 5

Anonymous
Not applicable

i want convert dwg files to jpg  with vb macro

0 Likes
Message 4 of 5

Alfred.NESWADBA
Consultant
Consultant

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 -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 5 of 5

Anonymous
Not applicable

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

0 Likes