yag
Guest
salve devo stampare un dwg in pdf sto usando questo codice:
dim ptconfigs as acadplotconfigurations
dim plotconfig as acadplotconfiguration
dim ptobj as acadplot
dim backplot as variant
'create a new plot configutrarion with all needed parameters
set ptobj = thisdrawing.plot
set ptconfigs = thisdrawing.plotconfigurations
'add a new plot configuration
ptconfigs.add "pdf", false
'the plot config you created become active
set plotconfig = ptconfigs.item("pdf")
'use this method to set the scale
plotconfig.standardscale = acscaletofit
'updates the plot
plotconfig.refreshplotdeviceinfo
'here you specify the pc3 file you want to use
plotconfig.configname = "dwg to pdf.pc3"
'you can select the plot style table here
plotconfig.stylesheet = "acad.ctb"
'specifies whether or not to plot using the plot styles
plotconfig.plotwithplotstyles = true
'thisdrawing.layouts("model").canonicalmedianame = "a4"
'if you are going to create pdf files in a batch mode,
'i would recommend to turn off the backgroundplot system variable,
'so autocad will not continue to do anything until finishes
'the pdf creation
backplot = thisdrawing.getvariable("backgroundplot")
thisdrawing.setvariable "backgroundplot", 0
'updates the plot
plotconfig.refreshplotdeviceinfo
'now you can use the plottofile method
if ptobj.plottofile(replace(thisdrawing.fullname, "dwg", "pdf"), plotconfig.configname) then
msgbox "pdf was created"
else
msgbox "pdf creation unsuccessful"
end if
'if you wish you can delete th plot configuration you created
'programmatically, and set the 'backgroundplot' system variable
'to its original status.
ptconfigs.item("pdf").delete
set plotconfig = nothing
thisdrawing.setvariable "backgroundplot", backplot
però dovrei impostare il formato del foglio su a0 come fare ?
dim ptconfigs as acadplotconfigurations
dim plotconfig as acadplotconfiguration
dim ptobj as acadplot
dim backplot as variant
'create a new plot configutrarion with all needed parameters
set ptobj = thisdrawing.plot
set ptconfigs = thisdrawing.plotconfigurations
'add a new plot configuration
ptconfigs.add "pdf", false
'the plot config you created become active
set plotconfig = ptconfigs.item("pdf")
'use this method to set the scale
plotconfig.standardscale = acscaletofit
'updates the plot
plotconfig.refreshplotdeviceinfo
'here you specify the pc3 file you want to use
plotconfig.configname = "dwg to pdf.pc3"
'you can select the plot style table here
plotconfig.stylesheet = "acad.ctb"
'specifies whether or not to plot using the plot styles
plotconfig.plotwithplotstyles = true
'thisdrawing.layouts("model").canonicalmedianame = "a4"
'if you are going to create pdf files in a batch mode,
'i would recommend to turn off the backgroundplot system variable,
'so autocad will not continue to do anything until finishes
'the pdf creation
backplot = thisdrawing.getvariable("backgroundplot")
thisdrawing.setvariable "backgroundplot", 0
'updates the plot
plotconfig.refreshplotdeviceinfo
'now you can use the plottofile method
if ptobj.plottofile(replace(thisdrawing.fullname, "dwg", "pdf"), plotconfig.configname) then
msgbox "pdf was created"
else
msgbox "pdf creation unsuccessful"
end if
'if you wish you can delete th plot configuration you created
'programmatically, and set the 'backgroundplot' system variable
'to its original status.
ptconfigs.item("pdf").delete
set plotconfig = nothing
thisdrawing.setvariable "backgroundplot", backplot
però dovrei impostare il formato del foglio su a0 come fare ?