Triggered iLogicCode only working on one machine

Triggered iLogicCode only working on one machine

RNDinov8r
Collaborator Collaborator
404 Views
5 Replies
Message 1 of 6

Triggered iLogicCode only working on one machine

RNDinov8r
Collaborator
Collaborator

So, I have this code (I believe it is a provided snippet verbatum) that I run on the close of every drawing.

' Get the DXF translator Add-In.
Dim DXFAddIn As TranslatorAddIn
DXFAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC4-122E-11D5-8E91-0010B541CD80}")
'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 = IOMechanismEnum.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 DXFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
Dim strIniFile As String
strIniFile = "C:\temp\dxfout.ini"
' Create the name-value that specifies the ini file to use.
oOptions.Value("Export_Acad_IniFile") = strIniFile
End If
'Set the destination file name
oDataMedium.FileName = ThisDoc.PathAndFileName(False) & ".dxf"
'Publish document.
DXFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
'Launch the dxf file in whatever application Windows is set to open this document type with

 

When I set the trigger to run "On Close" in the drawings tab, it works fine on my machine. But it seems every other Engineering that uses this, gets an error when they close the drawing. I can't for the life of me figure out why that would be. We all point to the same directories. Even if they manually run it, they still get the same message.

 

RNDinov8r_0-1621517497862.png

 

0 Likes
405 Views
5 Replies
Replies (5)
Message 2 of 6

bradeneuropeArthur
Mentor
Mentor

is this available for all machines?

 

strIniFile = "C:\temp\dxfout.ini"

Could you upload that file 

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 3 of 6

bradeneuropeArthur
Mentor
Mentor

Try to change this:

 

'Set the destination file name
oDataMedium.FileName = oDocument.PathAndFileName(False) & ".dxf"
'Publish document.
DXFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)

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 4 of 6

RNDinov8r
Collaborator
Collaborator

That ini file does not even exist on my machine that I can see (Unless it is something that is being temporarily created and then removed.

 

When I made that change to "oDocument", then the code wouldn't run on my machine either...

0 Likes
Message 5 of 6

bradeneuropeArthur
Mentor
Mentor

Take a look if these settings are the same for each machine:

bradeneuropeArthur_0-1621520720729.png

 

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 6 of 6

WCrihfield
Mentor
Mentor

Another place to check for that ini file is at the following location is under your "Design Data\ DWG-DXF\" folder.  That's where the default ones are located, and might be where your custom one is (if you have a custom one).  This is an example of the full path where that folder would default to, if you haven't changed it:

C:\Users\Public\Documents\Autodesk\Inventor 2021\Design Data\DWG-DXF\

(of course the inventor version part might be different)

Anyways, if multiple user are running this code from different PC's, that file needs to either be on a shared network location where everyone can point to it, or there needs to be a copy of the same file in the same place on everyones PC's, to avoid errors.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes