Gian704
Guest
work with inventor 2021, first with 2014 I was able to create files in pdf and dwg with the macro visual basic that you posted here, now with the 2021 it is no longer possible to use visual basic, I would like to know if someone is able to do the same with ilogic, I fucked the old macro, it works but does not create files with the revision that I imposed, take off here what I have combined, someone will tell me where is the error
thank you to those who want to answer me.
syntaxeditor code snippet
strfolder = "c:\users\acer\desktop\dwg-dxf-pdf\" & thisdoc.filename(false) 'without extension
thisdoc.document.saveas(strfolder & (".pdf), true
'ooptions.value('all_color_as_black') = 0
'ooptions.value("remove_line_weights") = 0
'ooptions.value("vector_resolution") = 600
'ooptions.value("sheet_range") = kprintallsheets
'ooptions.value('custom_begin_sheet') = 1
'ooptions.value('custom_end_sheet') = 5
' revision number
dim srev as string
rev = inputbox("revision:? ", "input revision number", "00")
ocustompropset = ("{d5cd505-2e9c-101b-9397-08002b2cf9ae")
on error resume next
dim scod as string
' replace "code" with the name used for the hyperperty that interests you
scod = ocustompropset.item("code").value
filename = filename & " rev. " & rev & ""
'get the pdf translator add-in.
dim pdfaddin as translatoraddin
pdfaddin = thisapplicationaddins.itembyid("{0ac6fd96-2f4d-42ce-8be0-8aea580399e4}")
dim strinifile as string
' common init
' created in context
dim ocontext as translationcontext
ocontext = thisapplication.transientobjects.createtranslationcontext
ocontext.type = kfilebrowseiomechanism
' created in namevaluemap object
dim ooptions as namevaluemap
ooptions = thisapplication.transientobjects.createnamevaluemap
' created at datamedium object
dim odatamedium as datamedium
odatamedium = thisapplication.transientobjects.createdatamedium
'function that returns the file name by removing the path and suffix
'toglie il .ipt
if trunc = true then
filename = strings.left(filename, len(filename) - 4)
end if
dim pos as integer
'cycle that removes the path: finds "\" and keeps everything right
♪
pos = instr(filename, "\")
filename = strings.right(filename, len(filename) - pos)
loop until pos = 0
islandname = filename
thank you to those who want to answer me.
syntaxeditor code snippet
strfolder = "c:\users\acer\desktop\dwg-dxf-pdf\" & thisdoc.filename(false) 'without extension
thisdoc.document.saveas(strfolder & (".pdf), true
'ooptions.value('all_color_as_black') = 0
'ooptions.value("remove_line_weights") = 0
'ooptions.value("vector_resolution") = 600
'ooptions.value("sheet_range") = kprintallsheets
'ooptions.value('custom_begin_sheet') = 1
'ooptions.value('custom_end_sheet') = 5
' revision number
dim srev as string
rev = inputbox("revision:? ", "input revision number", "00")
ocustompropset = ("{d5cd505-2e9c-101b-9397-08002b2cf9ae")
on error resume next
dim scod as string
' replace "code" with the name used for the hyperperty that interests you
scod = ocustompropset.item("code").value
filename = filename & " rev. " & rev & ""
'get the pdf translator add-in.
dim pdfaddin as translatoraddin
pdfaddin = thisapplicationaddins.itembyid("{0ac6fd96-2f4d-42ce-8be0-8aea580399e4}")
dim strinifile as string
' common init
' created in context
dim ocontext as translationcontext
ocontext = thisapplication.transientobjects.createtranslationcontext
ocontext.type = kfilebrowseiomechanism
' created in namevaluemap object
dim ooptions as namevaluemap
ooptions = thisapplication.transientobjects.createnamevaluemap
' created at datamedium object
dim odatamedium as datamedium
odatamedium = thisapplication.transientobjects.createdatamedium
'function that returns the file name by removing the path and suffix
'toglie il .ipt
if trunc = true then
filename = strings.left(filename, len(filename) - 4)
end if
dim pos as integer
'cycle that removes the path: finds "\" and keeps everything right
♪
pos = instr(filename, "\")
filename = strings.right(filename, len(filename) - pos)
loop until pos = 0
islandname = filename
Last edited: