- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm obviously doing something wrong... but can't for the life of me figure out what (Not super VBA savvy).
'preamble in VBA
Dim ClientId As String
ClientId = "{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}"
Dim iLogicAddIn As ApplicationAddIn
Set iLogicAddIn = ThisApplication.ApplicationAddIns.ItemById(ClientId)
Dim iLogicAuto As Object
Set iLogicAuto = iLogicAddIn.Automation
If (iLogicAuto Is Nothing) Then
Call MsgBox("Can not use iLogic")
Exit Sub
End If
'Works in iLogic
'''Dim iLogicAuto = iLogicVb.Automation
'''Dim ilogicPath As String() = {"C:\Vault\Testing\", "C:\Vault\Testing2\"}
'''iLogicAuto.FileOptions.ExternalRuleDirectories = ilogicPath
'Doesn't work in VBA
Dim ilogicPath As String
ilogicPath = Array("C:\Vault\Testing\", "C:\Vault\Testing2\")
Let iLogicAuto.FileOptions.ExternalRuleDirectories = ilogicPath
Relevant:
https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=a6d2fdcb-7753-9394-07c4-adb50a85b9e8
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
Try
'preamble in VBA
Dim ClientId As String
ClientId = "{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}"
Dim iLogicAddIn As ApplicationAddIn
Set iLogicAddIn = ThisApplication.ApplicationAddIns.ItemById(ClientId)
Dim iLogicAuto As Object
Set iLogicAuto = iLogicAddIn.Automation
If (iLogicAuto Is Nothing) Then
Call MsgBox("Can not use iLogic")
Exit Sub
End If
'Works in iLogic
'''Dim iLogicAuto = iLogicVb.Automation
'''Dim ilogicPath As String() = {"C:\Vault\Testing\", "C:\Vault\Testing2\"}
'''iLogicAuto.FileOptions.ExternalRuleDirectories = ilogicPath
'Doesn't work in VBA
Dim ilogicPath() As String
ilogicPath() = Split("C:\Vault\Testing\,C:\Vault\Testing2\", ",")
iLogicAuto.FileOptions.ExternalRuleDirectories = ilogicPath
R. Krieg
RKW Solutions
www.rkw-solutions.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
For anyone else trying to do this; if you want it to just be a single path for the external iLogic folders, here's the code:
Dim ilogicPath() As String
ilogicPath() = Split("Your Path Here", ",")
iLogicAuto.FileOptions.ExternalRuleDirectories = ilogicPath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
msgbox (iLogicAuto.FileOptions.ExternalRuleDirectories.item(1))....
for example
Regards,
Arthur Knoors
Autodesk Affiliations:
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: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 !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The 'ExternalRuleDirectories' is stored as a 1-dimensional array.
You could probably create a quick function that would look for the comma (,) and then parse it into an array that's returned. The quick snip below puts it into a regular string that you can just manipulate or you can try and deal with the array as it is.
Dim output As String = String.Join(", ", iLogicAuto.FileOptions.ExternalRuleDirectories) Logger.Info(output)