Hello, I am asking questions through a translator.
Among the three attached files, I used the i-Logic called pdf2014 well in the inventer 2014 version, but when I upgraded the inventer to the 2021 version and tried to use pdf2014, an error occurred
So even though I wrote a modified i_logic called pdf2021, I still get an error in the pdf_error_message file.
What should I modify in pdf2021 to solve it?
The product build is 421 and the release is 2021.5.2.
Solved! Go to Solution.
Solved by Michael.Navara. Go to Solution.
Solved by vpeuvion. Go to Solution.
Hi,
I have the impression that your code was written twice, the error message comes from the fact that you used variables in a first part of the code and that you declared them in a second part. You must first declare the variable and then use it.
First part :
Second part :
Example :
First: Dim oContext as translationContext
Then: oContext = ThisApplication...
Hope this will help you.
Vincent.
As @vpeuvion mentioned above, it is recommended to use Dim before you declare variable. But the issue is in different line. The call for HasSaveCopyAs is different. You need to pass Document instead of DataMedium as the first argument. See line 18 below.
'------start of iLogic-------
Dim oPath = "C:\Temp\DWG EXPORT" ' "D:\DWG EXPORT"
Dim oFileName = ThisDoc.FileName(False) 'without extension
Dim oPDFAddIn As TranslatorAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
Dim oDocument = ThisApplication.ActiveDocument
Dim oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
Dim oOptions = ThisApplication.TransientObjects.CreateNameValueMap
Dim oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
'Define the drawing
Dim oDrawing As DrawingDocument
oDrawing = ThisDoc.Document
'set PDF Options
'If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
If oPDFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
Can't find what you're looking for? Ask the community or share your knowledge.