ilogic auto save pdf

ilogic auto save pdf

sandhalet
Contributor Contributor
8,657 Views
33 Replies
Message 1 of 34

ilogic auto save pdf

sandhalet
Contributor
Contributor

Hi.

 

I've used this Ilogic rule for years now.

But when i updated to inventor 2018 it wont work anymoore.

can anyone spot an error in this rule ?

 

See attached images for error message.

Thank you.

 

-Stian Sandhåland

 

SyntaxEditor Code Snippet

oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension
oRevNum = iProperties.Value("project", "revision number")
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium 


If oPDFAddIn.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 = "k:\dwg\pdf\"


'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


 'Set the PDF target file name
oDataMedium.FileName = oFolder & "\" & oFileName & _
" rev" & oRevNum & ".pdf" 


'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) 
'------end of iLogic-------

 

0 Likes
Accepted solutions (2)
8,658 Views
33 Replies
Replies (33)
Message 2 of 34

t_hascj
Autodesk
Autodesk

Hi sandhalet,

Similar issue was resolved in this discussion. https://forums.autodesk.com/t5/inventor-forum/pdf-ilogic/td-p/7409690

Try to add Dim to code.

Dim oContext As TranslationContext
Dim oOptions As NameValueMap
Dim oDataMedium As DataMedium

Thanks,
Jaroslav

Message 3 of 34

sandhalet
Contributor
Contributor

thx for reply

 

Tried adding dim to my code, but it didn't help.

 

but the code i found on the link works,

 

I was unable to change the save location however, it just saves the pdf in the same location as the idw file.

i tried to paste some of the code old code into the new code

 

SyntaxEditor Code Snippet

oFolder = "k:\dwg\pdf\"

But then the code does nothing.

i probably has to delete the part of the code saying to save the pdf at the idw location ?

 

 

-Stian

0 Likes
Message 4 of 34

t_hascj
Autodesk
Autodesk

Probably there is problem with duplicate "\"

oFolder = "k:\dwg\pdf"
oDataMedium.FileName = oFolder & "\" & oFileName &


Jaroslav

Message 5 of 34

MechMachineMan
Advisor
Advisor
Accepted solution

Try this revised version.

 

oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension
oRevNum = iProperties.Value("project", "revision number")
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium 


If oPDFAddIn.HasSaveCopyAsOptions(oDocument, 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 = "k:\dwg\pdf\"


'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


 'Set the PDF target file name
oDataMedium.FileName = oFolder & "\" & oFileName & _
" rev" & oRevNum & ".pdf" 


'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) 
'------end of iLogic-------

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 6 of 34

sandhalet
Contributor
Contributor

Works perfectly.

 

Thanks 🙂

0 Likes
Message 7 of 34

mickmac06
Enthusiast
Enthusiast

Hi MechMachineMan,

I have copied your iLogic code that you very kindly posted on this forum, and I was wondering if you had a solution to save the PDFs into different folders? I want to save the PDFs into a dedicated PDF folder as shown in your iLogic, but your code creates a PDF folder, and all PDFs are saved into this one folder. I have a PDF folder created for each job, so depending on what job your are working on, the PDFs need to be saved to a PDF folder within the relevant job folder. Is this possible?

Thanks,

Mike 

0 Likes
Message 8 of 34

bradeneuropeArthur
Mentor
Mentor
oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension
oRevNum = iProperties.Value("project", "revision number")
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium 


If oPDFAddIn.HasSaveCopyAsOptions(oDocument, 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 = ThisDoc.Path & "\pdf" 'instead of "k:\dwg\pdf\"

'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


 'Set the PDF target file name
oDataMedium.FileName = oFolder & "\" & oFileName & _
" rev" & oRevNum & ".pdf" 


'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) 
'------end of iLogic-------

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 9 of 34

mickmac06
Enthusiast
Enthusiast

Thanks Bradeneurope, works a treat.

Regards,

Mike

0 Likes
Message 10 of 34

bradeneuropeArthur
Mentor
Mentor

Your thanks are appreciated.

 

Regards,

Autodesk Software: Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018
Programming Skills: Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Dimension Component! | Partlist Export! | Derive I-properties! | Vault Prompts Via API! | Vault Handbook/Manual!
Drawing Toggle Sheets! | Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 11 of 34

per.widegren
Contributor
Contributor

interesting and very useful i must say. Many Many thanks for showing how the code can look like.

Is there any way to add creation of STEP file as well?

And how would that look like.

Sorry for all those questions but I´m really new on this.

 

BR

Per

0 Likes
Message 12 of 34

bradeneuropeArthur
Mentor
Mentor

Yes:

oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension
oRevNum = iProperties.Value("project", "revision number")
oStepAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{90AF7F40-0C01-11D5-8E83-0010B541CD80}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium 


If oStepAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
' Set application protocol.
        ' 2 = AP 203 - Configuration Controlled Design
        ' 3 = AP 214 - Automotive Design
        oOptions.Value("ApplicationProtocolType") = 3

        ' Other options...
        'oOptions.Value("Author") = ""
        'oOptions.Value("Authorization") = ""
        'oOptions.Value("Description") = ""
        'oOptions.Value("Organization") = ""


End If 


'get Step target folder path
oFolder = "k:\dwg\Step\"


'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


 'Set the PDF target file name
oDataMedium.FileName = oFolder & "\" & oFileName & _
" rev" & oRevNum & ".stp" 


'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) 
'------end of iLogic-------

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 13 of 34

per.widegren
Contributor
Contributor

Hello again,

I have now get it up and run and it works well.

This code create a step file and a PDF file as well when I´m in drawing mode. Works brilliant 🙂 BUT.......

When the drawing is showing exploded views it will not work No STEP file created just and PDF.

Is there any way to grab the source file (.IAM)from where the presentation mode (*.IPN) are build on?

This is how my code looks like right now.

 

SyntaxEditor Code Snippet

'define the model referenced by the drawing
Dim oModelDoc = ThisDoc.ModelDocument
' Get the STEP translator Add-In.
Dim oSTEPTranslator As TranslatorAddIn
oSTEPTranslator = ThisApplication.ApplicationAddIns.ItemById("{90AF7F40-0C01-11D5-8E83-0010B541CD80}")
Dim oContext As TranslationContext
oContext = ThisApplication.TransientObjects.CreateTranslationContext
Dim oOptions As NameValueMap
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
If oSTEPTranslator.HasSaveCopyAsOptions(oModelDoc, oContext, oOptions) Then

'Options for STEP output
oOptions.Value("ApplicationProtocolType") = 3 'Set application protocol: 2 = AP 203 - Configuration Controlled Design, 3 = AP 214 - Automotive Design
oOptions.Value("Author") = ThisApplication.GeneralOptions.UserName
oOptions.Value("Authorization") = ""
oOptions.Value("Tolerance") = "0.00001 mm"
oOptions.Value("Description") = iProperties.Value("Summary", "Title")
oOptions.Value("Organization") = "IKM Technique AS"

oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
Dim oData As DataMedium
oData = ThisApplication.TransientObjects.CreateDataMedium



FilePath= ThisDoc.Path    'This .IDW's path
OutputPath = FilePath & "\" & "STP"    'Output destination for the new STP
OutputFileName = iProperties.Value("Project", "Part Number") '& "Rev" & oRevnum & ".stp" 'Output File Name as specified in Custom iProperties, as specified by the iLogic rule OutputFileName

'Check for existance of STP folder and create if not found
If Not System.IO.Directory.Exists(OutputPath) Then
    System.IO.Directory.CreateDirectory(OutputPath)
End If


oRevNum = iProperties.Value("project", "revision number")

'Set the destination path & file name
oData.FileName = OutputPath & "\" & OutputFileName & "_Rev_" & oRevNum & ".stp"

'Publish Document
oSTEPTranslator.SaveCopyAs(oModelDoc, oContext, oOptions, oData)
End If

  

 

0 Likes
Message 14 of 34

bradeneuropeArthur
Mentor
Mentor
Dim a As Application
Set a = ThisApplication

Dim b As PresentationDocument
Set b = a.ActiveDocument


'define the model referenced by the drawing
Dim oModelDoc = b.ReferencedDocuments.Item(1)'ThisDoc.ModelDocument
' Get the STEP translator Add-In.
Dim oSTEPTranslator As TranslatorAddIn
oSTEPTranslator = ThisApplication.ApplicationAddIns.ItemById("{90AF7F40-0C01-11D5-8E83-0010B541CD80}")
Dim oContext As TranslationContext
oContext = ThisApplication.TransientObjects.CreateTranslationContext
Dim oOptions As NameValueMap
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
If oSTEPTranslator.HasSaveCopyAsOptions(oModelDoc, oContext, oOptions) Then

'Options for STEP output
oOptions.Value("ApplicationProtocolType") = 3 'Set application protocol: 2 = AP 203 - Configuration Controlled Design, 3 = AP 214 - Automotive Design
oOptions.Value("Author") = ThisApplication.GeneralOptions.UserName
oOptions.Value("Authorization") = ""
oOptions.Value("Tolerance") = "0.00001 mm"
oOptions.Value("Description") = iProperties.Value("Summary", "Title")
oOptions.Value("Organization") = "IKM Technique AS"

oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
Dim oData As DataMedium
oData = ThisApplication.TransientObjects.CreateDataMedium



FilePath = ThisDoc.Path   'This .IDW's path
OutputPath = FilePath & "\" & "STP"    'Output destination for the new STP
OutputFileName = iProperties.Value("Project", "Part Number") '& "Rev" & oRevnum & ".stp" 'Output File Name as specified in Custom iProperties, as specified by the iLogic rule OutputFileName

'Check for existance of STP folder and create if not found
If Not System.IO.Directory.Exists(OutputPath) Then
    System.IO.Directory.CreateDirectory (OutputPath)
End If


oRevNum = iProperties.Value("project", "revision number")

'Set the destination path & file name
oData.FileName = OutputPath & "\" & OutputFileName & "_Rev_" & oRevNum & ".stp"

'Publish Document
oSTEPTranslator.SaveCopyAs(oModelDoc, oContext, oOptions, oData)
End If

Or use this:

Dim oModelDoc = ThisDoc.ReferencedDocuments.Item
Dim oSTEPTranslator As TranslatorAddIn
oSTEPTranslator = ThisApplication.ApplicationAddIns.ItemById("{90AF7F40-0C01-11D5-8E83-0010B541CD80}")
Dim oContext As TranslationContext
oContext = ThisApplication.TransientObjects.CreateTranslationContext
Dim oOptions As NameValueMap
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
If oSTEPTranslator.HasSaveCopyAsOptions(oModelDoc, oContext, oOptions) Then

'Options for STEP output
oOptions.Value("ApplicationProtocolType") = 3 'Set application protocol: 2 = AP 203 - Configuration Controlled Design, 3 = AP 214 - Automotive Design
oOptions.Value("Author") = ThisApplication.GeneralOptions.UserName
oOptions.Value("Authorization") = ""
oOptions.Value("Tolerance") = "0.00001 mm"
oOptions.Value("Description") = iProperties.Value("Summary", "Title")
oOptions.Value("Organization") = "IKM Technique AS"

oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
Dim oData As DataMedium
oData = ThisApplication.TransientObjects.CreateDataMedium



FilePath = ThisDoc.Path   'This .IDW's path
OutputPath = FilePath & "\" & "STP"    'Output destination for the new STP
OutputFileName = iProperties.Value("Project", "Part Number") '& "Rev" & oRevnum & ".stp" 'Output File Name as specified in Custom iProperties, as specified by the iLogic rule OutputFileName

'Check for existance of STP folder and create if not found
If Not System.IO.Directory.Exists(OutputPath) Then
    System.IO.Directory.CreateDirectory (OutputPath)
End If


oRevNum = iProperties.Value("project", "revision number")

'Set the destination path & file name
oData.FileName = OutputPath & "\" & OutputFileName & "_Rev_" & oRevNum & ".stp"

'Publish Document
oSTEPTranslator.SaveCopyAs(oModelDoc, oContext, oOptions, oData)
End If

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 15 of 34

per.widegren
Contributor
Contributor

Many thanks for the quick replay 🙂 Sorry to say but it´s not working,

 

I got this error in your second code

 

Rule Compile Errors in export4_step, in MEA00016.idw

Error on Line 1 : 'ReferencedDocuments' is not a member of 'Autodesk.iLogic.Interfaces.ICadDoc'.

 

and when I run your first code it gives me this error....

 

Rule Compile Errors in export5_step, in MEA00016.idw

Error on Line 2 : 'Let' and 'Set' assignment statements are no longer supported.
Error on Line 5 : 'Let' and 'Set' assignment statements are no longer supported.

 

The stucture looks like this...

DRW.PNG

It´s pretty much a standard setup i think...

IAM to IPN to DRW

 

 

 

 

 

 

0 Likes
Message 16 of 34

bradeneuropeArthur
Mentor
Mentor

The following:

 

Dim a As Application
Set a = ThisApplication

Dim b As PresentationDocument
Set b = a.ActiveDocument


'define the model referenced by the drawing
Dim oModelDoc As Document
Set oModelDoc = a.Documents.Open(b.ReferencedDocuments.Item(1).FullDocumentName)

Put this in place.....

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 17 of 34

per.widegren
Contributor
Contributor

Thank you for trying and your time you spend on this 🙂

Now it looks like this...

DRW2.PNG

0 Likes
Message 18 of 34

bradeneuropeArthur
Mentor
Mentor

remove all "set" for ilogic

"set" is for VBA

 

Dim a As Application
 a = ThisApplication

Dim b As PresentationDocument
 b = a.ActiveDocument


'define the model referenced by the drawing
Dim oModelDoc As Document
 oModelDoc = a.Documents.Open(b.ReferencedDocuments.Item(1).FullDocumentName)

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 19 of 34

per.widegren
Contributor
Contributor

hmm this wasn´t like "a walk thru the park" 🙂

Now it give me this back....

Error in rule: export5_step, in document: MEA00016.idw

Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.PresentationDocument'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{29F0D46C-C114-11D2-B77F-0060B0F159EF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

0 Likes
Message 20 of 34

bradeneuropeArthur
Mentor
Mentor

The code was intended to run from the ipn file not from the drawing.

Do you need it to be run from the drawing instead? 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes