3°minore
Guest
Good morning, everyone.
work with inventor 2011;
are in possession of a macro vba, taken from a discussion in this forum and modified slightly, for the automatic printing of the boards of subgroups .iam and their individual parts .ipt, which make up a .iam file.
I now need to print only tables associated with .iam subgroups appearing in separate components, excluding those associated with .ipt files and .iam files referenced.
Can someone suggest me if it is possible, and how, change the macro?
cup and neck:
work with inventor 2011;
are in possession of a macro vba, taken from a discussion in this forum and modified slightly, for the automatic printing of the boards of subgroups .iam and their individual parts .ipt, which make up a .iam file.
I now need to print only tables associated with .iam subgroups appearing in separate components, excluding those associated with .ipt files and .iam files referenced.
Can someone suggest me if it is possible, and how, change the macro?
cup and neck:
Code:
function fileexists(fname) as boolean
if dir(fname) <> "" then fileexists = true else fileexists = false
end function
public sub stampa_tutte_le_tavole_in_a4()
dim oasmdoc as assemblydocument
set oasmdoc = thisapplication.activedocument
if thisapplication.activedocument.documenttype <> kassemblydocumentobject then
msgbox "this is not an assembly document!", vbexclamation
exit sub
end if
dim oprintmgr as printmanager
set oprintmgr = thisapplication.activedocument.printmanager
if msgbox("usare la stampante di default """ & oprintmgr.printer & """ vuoi continuare?", vbyesno + vbquestion) = vbno then
exit sub
end if
dim odrgprintmgr as drawingprintmanager
msgbox "stampante selezionata " & oprintmgr.printer & ", stampare 1 copia, formato a4."
dirpath = left(oasmdoc.fullfilename, len(oasmdoc.fullfilename) - len(oasmdoc.displayname))
dim orefdocs as documentsenumerator
set orefdocs = oasmdoc.allreferenceddocuments
dim orefdoc as document
numfiles = 0
for each orefdoc in orefdocs
idwpathname = left(orefdoc.fulldocumentname, len(orefdoc.fulldocumentname) - 3) & "idw"
if fileexists(idwpathname) then
numfiles = numfiles + 1
'if numfiles = 10 then exit sub
dim odrawdoc as drawingdocument
set odrawdoc = thisapplication.documents.open(idwpathname, true)
odrawdoc.activate
set odrawdoc = thisapplication.activedocument
set odrgprintmgr = odrawdoc.printmanager
odrgprintmgr.allcolorsasblack = true
odrgprintmgr.scalemode = kprintbestfitscale
set oprintmgr = thisapplication.activedocument.printmanager
' printer setup, default printer
oprintmgr.colormode = kprintdefaultcolormode ' set to default
oprintmgr.numberofcopies = 1 ' set to print one copies.
oprintmgr.papersize = kpapersizea4 'set the paper size.
oprintmgr.submitprint ' submit the print.
odrawdoc.close (true)
end if
next
msgbox numfiles & " file sono stati inviati alla stampante."