Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Check if part is on workspace if not then download from vault (iLogic)

KenVaessen
Enthusiast

Check if part is on workspace if not then download from vault (iLogic)

KenVaessen
Enthusiast
Enthusiast

Is there an iLogic code that I can implement that checks if a part is on my workspace. If not then download this file from the vault

0 Likes
Reply
735 Views
11 Replies
Replies (11)

bradeneuropeArthur
Mentor
Mentor
Public Sub main()

Dim a As Application
Set a = ThisApplication

Dim CmdMan As ControlDefinition
    Set CmdMan = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckout")
    
    If CmdMan.Enabled = True Then
    CmdMan.Execute
        'CmdMan.Execute2 (True)
    End If
    
    
End Sub

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 !

0 Likes

bradeneuropeArthur
Mentor
Mentor
Modified the last post....

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 !

0 Likes

KenVaessen
Enthusiast
Enthusiast

I got the next error when I run this rule in iLogic:

 

Rule Compile Errors in Rule0, in afvoerbuis test samenstelling.iam

 

Error on Line 4 : Let- en Set-assignment instructions are no longer supported.
Error on Line 7 : Let- en Set-assignment instructions are no longer supported.

0 Likes

bradeneuropeArthur
Mentor
Mentor

Public Sub main()

Dim a As Application

 a = ThisApplication

Dim CmdMan As ControlDefinition

 CmdMan = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckout")

If CmdMan.Enabled = True Then

CmdMan.Execute 'CmdMan.Execute2 (True)

End If

End Sub

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 !

0 Likes

KenVaessen
Enthusiast
Enthusiast

I've deleted the part in my workspace and runned the rule you wrote.

 

But he doesn't download the file from the vault (see attachment).

0 Likes

bradeneuropeArthur
Mentor
Mentor
Set you project to straight VBA code

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 !

0 Likes

KenVaessen
Enthusiast
Enthusiast

How do I do that exactly?

0 Likes

bradeneuropeArthur
Mentor
Mentor

Is your Vault activated within inventor?

 

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 !

0 Likes

KenVaessen
Enthusiast
Enthusiast

yes it's active

0 Likes

bradeneuropeArthur
Mentor
Mentor

try it in a different way:

For VBA:

Public Sub main()
Dim a As Application
set a = ThisApplication
Dim CmdMan As ControlDefinition
set CmdMan = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckoutTop")
If CmdMan.Enabled = True Then
MsgBox "will be checked out"
CmdMan.Execute 'CmdMan.Execute2 (True)
End If
End Sub

For I logic

Public Sub Main()
Dim a As Application
a = ThisApplication
Dim CmdMan As ControlDefinition
CmdMan = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckoutTop")
If CmdMan.Enabled = True Then
MsgBox ("will be checked out")
CmdMan.Execute 'CmdMan.Execute2 (True)
End If
End Sub

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:

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 !

0 Likes

KenVaessen
Enthusiast
Enthusiast

Still doesn't work. So I've  checked the assy out of the vault. I saved the assy to my workspace and all the parts are in the directory. Now I start the assy out of my workspace and I delete a part in this directory on the workspace. If I run the rule the part doesn't return in my workspace directory.

0 Likes