Export to pdf and creating 3d PDF

Export to pdf and creating 3d PDF

Yashasvi23481
Collaborator Collaborator
398 Views
9 Replies
Message 1 of 10

Export to pdf and creating 3d PDF

Yashasvi23481
Collaborator
Collaborator

Hi All,

 

   I am using IV2025. I have 2 questions, 1 for shortcut to pdf from drawing and another is creating 3d pdf. 

 

I have been doing too many drawings and need to pdf on regular basis to share with client. I have to use mouse button thrice file, export and then pdf. Just wondering if there is an existing shortcut like F# to create pdf in 1 click. It may sound just 2 clicks more but when you are working with 200 idw to convert, its time consuming. Or can i create short cut, if so how?

 

Secondly, i need to work on 3d pdf to share model with others. I tried iges and other file conversion but file size is too big and have to use google drive and give access. I used to do earlier and it was good. Client wants only to view and measure or see interference. Now when i do same way, i get blank screen. See the simple Assy in screenshot attached in zip file. 

 

image 1 to 3 are settings and 4 is final outcome with blank screen. earlier, there use to be yellow bar prompting to display view now its not coming. 

 

What am i missing ? I also read on earlier thread somewhere a week ago about shared view collaboration. Firstly, i want to know how to do this correctly and secondly, what does client require to do shared view? or if i use collaboration ? 3d pdf is still better as ppl can open on their mobile and tabs. Do you need foxit pdf or Adobe Acrobat is fine? I am having acrobat. Please advise and help. 

 

 

Regards,

Yash

0 Likes
Accepted solutions (2)
399 Views
9 Replies
Replies (9)
Message 2 of 10

YannickEnrico
Advisor
Advisor

Hello @Yashasvi23481 

 

You can use iLogic to create a rule that saves a PDF alongside your DWG/IDW whenever you save. The code snippet below is one I've used succesfully for years across multiple versions of Inventor

 

For the question about 3D PDF, you usually have to wait a moment, or try dragging the window for the bar to show up. Pardon the Danish in the screenshot below. You have to press settings -> Allow once. That's my experience anyhow.

 

Sub Main()
    ' Get the PDF translator Add-In.
    Dim PDFAddIn As TranslatorAddIn
     PDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")

    'Set a reference to the active document (the document to be published).
    Dim oDocument As Document
     oDocument = ThisApplication.ActiveDocument

    Dim oContext As TranslationContext
     oContext = ThisApplication.TransientObjects.CreateTranslationContext
    oContext.Type = kFileBrowseIOMechanism

    ' Create a NameValueMap object
    Dim oOptions As NameValueMap
     oOptions = ThisApplication.TransientObjects.CreateNameValueMap

    ' Create a DataMedium object
    Dim oDataMedium As DataMedium
     oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

    ' Check whether the translator has 'SaveCopyAs' options
    If PDFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then

        ' Options for drawings...

        oOptions.Value("All_Color_AS_Black") = 0

        oOptions.Value("Remove_Line_Weights") = 1
        'oOptions.Value("Vector_Resolution") = 400
        oOptions.Value("Sheet_Range") = kPrintAllSheets
        'oOptions.Value("Custom_Begin_Sheet") = 2
        'oOptions.Value("Custom_End_Sheet") = 4

    End If

    'Set the destination file name
    'oDataMedium.FileName = "c:\temp\test.pdf"
Dim destFullFileName As String = IO.Path.ChangeExtension(oDocument.FullFileName,  ".pdf")
oDataMedium.FileName = Left(oDocument.FullFileName,Len(oDocument.FullFileName)-4)+"_Rev"+iProperties.Value("Project","Revision Number")+".pdf"

    'Publish document.
     PDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
	 
 end sub

 

YannickEnrico_0-1752122477403.png

 

_______________________________________________________________________________________
Intel Core i9-14900KF
64 GB DDR5 6000 MHz
2TB WD_BLACK
RTX A4000
------------------------------
Inventor 2026 Professional
0 Likes
Message 3 of 10

pcrawley
Advisor
Advisor

First question - Export PDF's:  I can give you a quick iLogic PDF export tool.  You can create a button on your user interface to run it.  Now it's only 1-click to export a PDF.

 

Second question - 3d PDF's:  Have you recently upgraded?  It may be that you don't have the 3d PDF templates in your Templates folder for the new version.
However - from what you describe as the requirement, have you tried "Shared Views" (It's on the "Collaborate" tab.)  These are significantly "better" than 3d PDFs because they're only a hyperlink, the markups come right back into your Inventor UI, they don't "share" any source files online - only the viewables, and there's a good set of measure and markup tools in the viewer.

Peter
Message 4 of 10

pcrawley
Advisor
Advisor

Forgot to include the iLogic...

 

Sub Main
	If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
		MsgBox("This Rule only works on Drawing Documents.  Exiting Rule.", vbExclamation, "iLogic")
		Exit Sub
	End If
	Dim oDDoc As DrawingDocument = ThisDoc.Document
	Dim sPathAndName As String = System.IO.Path.ChangeExtension(oDDoc.FullFileName, vbNullString)
	Dim sRev As String = oDDoc.PropertySets.Item(1).Item("Revision Number").Value
	Dim sDesc As String = oDDoc.PropertySets.Item(3).Item("Description").Value
	'Dim sNewFullName As String = sPathAndName & "_" & sRev & " (" & sDesc & ").pdf"
	Dim sNewFullName As String = sPathAndName & ".pdf"
	ExportToPDF(oDDoc, sNewFullName)
	
End Sub

Sub ExportToPDF(oDrawing As DrawingDocument, sNewFullFileName As String)
	Dim oPDF As TranslatorAddIn
	oPDF = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
	Dim oTO As TransientObjects = ThisApplication.TransientObjects
	Dim oContext As TranslationContext = oTO.CreateTranslationContext
	oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
	Dim oOptions As NameValueMap = oTO.CreateNameValueMap
	Dim oDataMedium As DataMedium = oTO.CreateDataMedium
	If System.IO.File.Exists(sNewFullFileName) = True Then
		oAns = MsgBox("A PDF file with this name already exists." & vbCrLf &
		"Do you want to overwrite it with this new one?",vbYesNo + vbQuestion + vbDefaultButton2, "PDF ALREADY EXISTS")
		If oAns = vbNo Then Exit Sub
	End If
	oDataMedium.FileName = sNewFullFileName
	If oPDF.HasSaveCopyAsOptions(oDrawing, oContext, oOptions) Then
		oOptions.Value("Publish_All_Sheets") = 1 ' 0 = False, 1 = True
		oOptions.Value("All_Color_AS_Black") = 0 ' 0 = False, 1 = True
		oOptions.Value("Vector_Resolution") = 720 '150, 200, 400, 600, 720, 1200, 2400, 4800 ' DPI
		oOptions.Value("Remove_Line_Weights") = 0 ' 0 = False, 1 = True
		oOptions.Value("Launch_Viewer") = 1 ' 0 = False, 1 = True
	End If
	Try
		oPDF.SaveCopyAs(oDrawing, oContext, oOptions, oDataMedium)
	Catch e As Exception
		Logger.Error("Error using SaveCopyAs method." & vbCrLf & e.Message & vbCrLf & e.StackTrace)
	End Try
	
	oAns = MsgBox("Publish Successful." & vbCrLf & "Open PDF For review ? ",vbYesNo + vbQuestion + vbDefaultButton2,  " iLogic ")
	If oAns = vbNo Then 
		Exit Sub
	End If
		ThisDoc.Launch(sNewFullFileName)
End Sub

 

Peter
0 Likes
Message 5 of 10

Yashasvi23481
Collaborator
Collaborator

Hi @YannickEnrico,

 

  I dont get the ? icon. its just blank. Will try again. Where do i paste this ilogic rule ? Is it in default idw template (so it comes with every drawing opened) or on ribbon on the idw drawing. ? 

 

Hi @pcrawley

 

Have you recently upgraded?  It may be that you don't have the 3d PDF templates in your Templates folder for the new version. - Where can i get them? is it under updates ? 

 

In regards to shared views, it says you need to be admin to use shared views but i am admin and sole user. This is what i get when i click on collaborate. Initially it asked to login but turned to this screen (as per attached).

 

Regards,

Yash

0 Likes
Message 6 of 10

YannickEnrico
Advisor
Advisor

Hi @Yashasvi23481 

 

It might be a question of templates then - They're installed with every new version of inventor and can usually be found here: 

C:\Users\Public\Documents\Autodesk\Inventor 2025\Templates\en-US

Called Sample Part Template.pdf and Sample Assembly Template.pdf

 

remember to choose the right inventor release folder if you have multiple. 

 

In regards to iLogic I'll post a series of screenshots:

1. 

YannickEnrico_0-1752141793432.png

2. 

Right click to bring up the menu. Choose a name and a place to save it.

YannickEnrico_1-1752141861773.png

 

3. 

A menu opens where you paste the code

YannickEnrico_3-1752142071603.png

 

4.

Manage -> Event Triggers -> Drawings -> Drag your new iLogic rule into the appropriate place

YannickEnrico_2-1752142022378.png

 

 

_______________________________________________________________________________________
Intel Core i9-14900KF
64 GB DDR5 6000 MHz
2TB WD_BLACK
RTX A4000
------------------------------
Inventor 2026 Professional
Message 7 of 10

Yashasvi23481
Collaborator
Collaborator

Hi Peter and Yannick,

 

ilogic rule works. i tried on couple of idw. But i have to copy and paste the rules everytime. Do i add it to template idw to ensure it happens on every idw opened with this template ? 

 

3d pdf and shared view is still under cloud. I am sole user and believe i am admin too. but i still get request for access as admin. I ran inventor using Run as administrator. Also, i have confirmed the version of inventor for assembly template is 2025. 

 

Regards,

Yashi

0 Likes
Message 8 of 10

pcrawley
Advisor
Advisor
Accepted solution

Follow @YannickEnrico suggestion in message 6 where you will see how to paste the rule as an "External" rule.  If you follow those steps, you will have the rule available all the time and you won't have to paste it into any documents.

 

Re Shared Views - Log into your Autodesk Account > Products and Services - you should see this if you search for "Shared":

pcrawley_0-1752202031524.png

If you don't, maybe contact Autodesk or your reseller for access.  (It is part of a standard subscription, so there's no extra cost - you should have it.)

 

 

Peter
0 Likes
Message 9 of 10

YannickEnrico
Advisor
Advisor
Accepted solution

Hi @Yashasvi23481 

 

As @pcrawley said, you have to follow my steps to add it as an external rule

It IS an option to add it to your template as a document rule, but that is a poor option, as any updates to the rule won't reflect on old documents. It will reflect on *any* documents if it's attached as an external rule

_______________________________________________________________________________________
Intel Core i9-14900KF
64 GB DDR5 6000 MHz
2TB WD_BLACK
RTX A4000
------------------------------
Inventor 2026 Professional
0 Likes
Message 10 of 10

Yashasvi23481
Collaborator
Collaborator

Hi @YannickEnrico @pcrawley,

 

   Both issues are now resolved. Although 3d pdf i couldnt get, but shared view covers that action. As you mentioned, its better tool for collab. 

 

Thanks.