• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

rule ilogic export boards dwg and pdf

  • Thread starter Thread starter crisbeta28
  • Start date Start date
Thank you.
I have a subdivision of folders like...

h:\project to -> containing 3d files
h:\project a\tavole -> containing all drawings associated with 3d
 
proof questo:

cation
Good morning to all, I am new to this forum and also regarding ilogic.
in the post above I found a rule to save from a table .idw a file in pdf format, I would need the same rule but to save a dwg of autocad in the preset version in my inventor.
I tried to change the rule but I don't know the environment and it doesn't work......
thanks to everyone in advance.
savior
 
Hello everyone,
I downloaded the zip file and entered the rule in inventor but when I run it always gives me a set of errors (unrestricted pointer etc...) use inventor 2018 and until now I had never had prob. can someone help me?
the situation is this:
I have a set, I have created the tables of details and assemblies (all in the same folder ) but the rule does not work
I need to export both pdf and dwg

I also tried with the modified rule but I can't make it work
thanks to all
 
Code:
if pdfaddin.hassavecopyasoptions(odatamedium, ocontext, ooptions) then <- commenta qua aggiungendo all'inizio riga '
ooptions.value("all_color_as_black") = 0
ooptions.value("remove_line_weights") = 1
ooptions.value("vector_resolution") = 400
ooptions.value("sheet_range") = inventor.printrangeenum.kprintallsheets
'ooptions.value("custom_begin_sheet") = 2
'ooptions.value("custom_end_sheet") = 4
end if <- commenta qua aggiungendo all'inizio riga '
becomes so
Code:
'if pdfaddin.hassavecopyasoptions(odatamedium, ocontext, ooptions) then <- commenta qua aggiungendo all'inizio riga '
ooptions.value("all_color_as_black") = 0
ooptions.value("remove_line_weights") = 1
ooptions.value("vector_resolution") = 400
ooptions.value("sheet_range") = inventor.printrangeenum.kprintallsheets
'ooptions.value("custom_begin_sheet") = 2
'ooptions.value("custom_end_sheet") = 4
'end if
change causes inventor 2018
 
ciao a tutti, ho provato a scaricare tutte le regole postate in questa discussione, ho inventor 2018 e nessuna mi funziona

utilizzando questa
syntaxeditor code snippet'define the active document as an assembly file
dim oasmdoc as assemblydocument
oasmdoc = thisapplication.activedocument
oasmname = left(oasmdoc.displayname, len(oasmdoc.displayname) -4)

'check that the active document is an assembly file
if thisapplication.activedocument.documenttype <> kassemblydocumentobject then
messagebox.show("please run this rule from the assembly file.", "ilogic")
exit sub
end if

'get user input
rusure = messagebox.show ( _
"this will create a pdf file for all of the asembly components that have drawings files." _
& vblf & "this rule expects that the drawing file shares the same name and location as the component." _
& vblf & " " _
& vblf & "are you sure you want to create pdf drawings for all of the assembly components?" _
& vblf & "this could take a while.", "ilogic - batch output pdfs ",messageboxbuttons.yesno)

if rusure = vbno then
return
else
end if

'- - - - - - - - - - - - -pdf setup - - - - - - - - - - - -
opath = thisdoc.path
pdfaddin = thisapplication.applicationaddins.itembyid("{0ac6fd96-2f4d-42ce-8be0-8aea580399e4}")
ocontext = thisapplication.transientobjects.createtranslationcontext
ocontext.type = iomechanismenum.kfilebrowseiomechanism
ooptions = thisapplication.transientobjects.createnamevaluemap
odatamedium = thisapplication.transientobjects.createdatamedium

if pdfaddin.hassavecopyasoptions(odatamedium, ocontext, ooptions) then
'ooptions.value("all_color_as_black") = 0
ooptions.value("remove_line_weights") = 1
ooptions.value("vector_resolution") = 400
ooptions.value("sheet_range") = inventor.printrangeenum.kprintallsheets
'ooptions.value("custom_begin_sheet") = 2
'ooptions.value("custom_end_sheet") = 4
end if

'get pdf target folder path
ofolder = opath & "\" & oasmname & " pdf files"

'check for the pdf folder and create it if it does not exist
if not system.io.directory.exists(ofolder) then
system.io.directory.createdirectory(ofolder)
end if
'- - - - - - - - - - - - -

'- - - - - - - - - - - - -component drawings - - - - - - - - - - - -
'look at the files referenced by the assembly
dim orefdocs as documentsenumerator
orefdocs = oasmdoc.allreferenceddocuments
dim orefdoc as document

'work the the drawing files for the referenced models
'this expects that the model has a drawing of the same path and name
for each orefdoc in orefdocs
idwpathname = left(orefdoc.fulldocumentname, len(orefdoc.fulldocumentname) - 3) & "idw"
'check to see that the model has a drawing of the same path and name
if(system.io.file.exists(idwpathname)) then
dim odrawdoc as drawingdocument
odrawdoc = thisapplication.documents.open(idwpathname, true)
ofilename = left(orefdoc.displayname, len(orefdoc.displayname) -3)

on error resume next ' if pdf exists and is open or read only, resume next
'set the pdf target file name
odatamedium.filename = ofolder & "\" & ofilename & "pdf"
'write out the pdf
call pdfaddin.savecopyas(odrawdoc, ocontext, ooptions, odatamedium)
'close the file
odrawdoc.close
else
'if the model has no drawing of the same path and name - do nothing
end if
next
'- - - - - - - - - - - - -

'- - - - - - - - - - - - -top level drawing - - - - - - - - - - - -
oasmdrawing = thisdoc.changeextension(".idw")
oasmdrawingdoc = thisapplication.documents.open(oasmdrawing, true)
oasmdrawingname = left(oasmdrawingdoc.displayname, len(oasmdrawingdoc.displayname) -3)
'write out the pdf for the top level assembly drawing file
on error resume next ' if pdf exists and is open or read only, resume next
'set the pdf target file name
odatamedium.filename = ofolder & "\" & oasmdrawingname & "pdf"
'write out the pdf
call pdfaddin.savecopyas(oasmdrawingdoc, ocontext, ooptions, odatamedium)
'close the top level drawing
oasmdrawingdoc.close
'- - - - - - - - - - - - -

messagebox.show("new files created in: " & vblf & ofolder, "ilogic")
'open the folder where the new ffiles are saved
shell("explorer.exe " & ofolder,vbnormalfocus)


mi esce questo errore1615486749679.webp1615486805369.webp
 
I know and use that plug-in... but now I was getting started to understand why the rule does not work
 
Code:
if pdfaddin.hassavecopyasoptions(odatamedium, ocontext, ooptions) then <- commenta qua aggiungendo all'inizio riga '
ooptions.value("all_color_as_black") = 0
ooptions.value("remove_line_weights") = 1
ooptions.value("vector_resolution") = 400
ooptions.value("sheet_range") = inventor.printrangeenum.kprintallsheets
'ooptions.value("custom_begin_sheet") = 2
'ooptions.value("custom_end_sheet") = 4
end if <- commenta qua aggiungendo all'inizio riga '
becomes so
Code:
'if pdfaddin.hassavecopyasoptions(odatamedium, ocontext, ooptions) then <- commenta qua aggiungendo all'inizio riga '
ooptions.value("all_color_as_black") = 0
ooptions.value("remove_line_weights") = 1
ooptions.value("vector_resolution") = 400
ooptions.value("sheet_range") = inventor.printrangeenum.kprintallsheets
'ooptions.value("custom_begin_sheet") = 2
'ooptions.value("custom_end_sheet") = 4
'end if
change causes inventor 2018
Did you apply these changes?
 
thanks catafract with that change it works

I also reported the change to the first rule1615572149432.pngDoes that unique thing even work for me??? Do you know how I can delete the creation of zip?? ?1615572261092.webpthe rule creates a folder that calls as a red arrow " and can make it call so nameassieme ok and then pdf-dwg "assieme3 pdf-dwg"
 
Good morning.
Does anyone have an ilogic rule that saves the tables of the parts of a pdf set, dwg but also dxf?
I tried the first of this post, because the subsequent changes (description) do not affect me, do not save dxf but only to see if it worked, but do nothing not by error but does not save any files.
Thank you.
 
Good morning to all.
I would need to turn the boards into inventor dwg into autocad dwg into a new folder to each rescue.
I am aware that it takes time and money, if someone has already done something like this and could help me, it would be great.

Thank you very much
 
I created an ilogic rule that saves a table in pdf, dxf and dwg all in the same folder that is to be defined in the first line of the rule:

syntaxeditor code snippetstrfolder = "c:\wrkvault\production\_export tables\" & thisdoc.filename(false) 'without extension
thisdoc.document.saveas(strfolder & (".pdf) , true
thisdoc.document.saveas(strfolder & (".dwg), true
thisdoc.document.saveas(strfolder & (".dxf) , true

messagebox.show("all formats were saved", "table lift")

I hope you need it.
 
Thank you very much, I'll try now.
do these two possibilities exist?
the first that you automatically create a folder within the workbook with the dwg conversion name, the second that you can assign to this rule a visible icon in the table environment.
Thank you very much in advance.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top