By Chandra shekar Gopal
Inventor iLoigc is very useful to Inventor developers due to easy development and easy deployment with in built editor. As iLogic rules can be attached or incorporated with Inventor documents, it encourages reusability of iLogic rules.
iLogic rules can be triggered an automatic update of a whole host of parameters, feature/component suppression and iProperty values based on a variety of actions like below.
- Parameter value change
- Model geometry or drawing view changes
- Software Events
- When a document is created
- Right before a document is saved
- On demand by the user
Inventor iLogic can also be used to establish vault connection and access vault file status. To demonstrate the same, below iLogic can be used to connect vault and access vault file status of current document.
AddReference "Autodesk.Connectivity.WebServices.dll"
Imports AWS = Autodesk.Connectivity.WebServices
AddReference "Autodesk.DataManagement.Client.Framework.Vault.dll"
Imports VDF = Autodesk.DataManagement.Client.Framework
AddReference "Connectivity.Application.VaultBase.dll"
Imports VB = Connectivity.Application.VaultBase
Dim mVltCon As VDF.Vault.Currency.Connections.Connection
mVltCon = VB.ConnectionManager.Instance.Connection
If mVltCon Is Nothing Then
Messagebox.Show("Not Logged In to Vault! - Login first and repeat executing this rule.")
Exit Sub
End If
Dim VaultPath As String = ThisDoc.PathAndFileName(True)
VaultPath = VaultPath.Replace("C:\$WorkingFolder\", "$/")
'flip the slashes
VaultPath = VaultPath.Replace("\", "/")
Dim VaultPaths() As String = New String() {VaultPath}
Dim wsFiels() As AWS.File = mVltCon.WebServiceManager.DocumentService.FindLatestFilesByPaths(VaultPaths)
Dim mFileIt As VDF.Vault.Currency.Entities.FileIteration = New VDF.Vault.Currency.Entities.FileIteration(conn,wsFiels(0))
Dim lifeCycleInfo As VDF.Vault.Currency.Entities.FileLifecycleInfo = mFileIt.LifecycleInfo
Messagebox.Show(lifeCycleInfo.Statename)
Note: Before using above iLogic rule, make sure that local working folder of vault is updated (VaultPath = VaultPath.Replace("C:\$WorkingFolder\", "$/")). Because, it is system specific. In my system, “C:\$WorkingFolder\” is the local working folder of Vault.