File is a new file, not known to vault

File is a new file, not known to vault

Anonymous
Not applicable
2,906 Views
32 Replies
Message 1 of 33

File is a new file, not known to vault

Anonymous
Not applicable

I am runnign an Ilogic script every file on save. The problem is that if this file is new, and hase never been checked in into vault before, then the vault window appears and has to be closed. I would like to run the script only if the file has already beed in vault once before. Is there a way to check this from within Ilogic? Thanks!

0 Likes
Accepted solutions (1)
2,907 Views
32 Replies
Replies (32)
Message 21 of 33

Anonymous
Not applicable

Great thanks! 

 

i warched on how to include the api in ilogic in the header but was not able to find anything.. have a nice weekend Braden

0 Likes
Message 22 of 33

bradeneuropeArthur
Mentor
Mentor
This will only work with an add in for me.
So this solution will be vb.net based.

You have a nice weekend too.

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 23 of 33

Anonymous
Not applicable

FOUND IT!!!!!!

 

 

 

doc.FileSaveCounter

 

is the version number of vault also 

0 Likes
Message 24 of 33

bradeneuropeArthur
Mentor
Mentor
This only checks the qty of saves. Nothing about the vault status or in or not in vault!

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 25 of 33

bradeneuropeArthur
Mentor
Mentor
Do I need to take a look at the Vault API?
Or is this with this really the solution.

Please let me know.
Otherwise I will not put effort in it.

Thanks.

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 26 of 33

Anonymous
Not applicable
If you have the time i would appreciate it.. As you mentioned its not the solution.. 😞
0 Likes
Message 27 of 33

bradeneuropeArthur
Mentor
Mentor
Of course.

Please provide me your code you need to run and I implement it in the add in derectly.

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 28 of 33

Anonymous
Not applicable
Thanks, i can send you the code on monday!
0 Likes
Message 29 of 33

Anonymous
Not applicable

Hello,

 

as requested here is my entire code.. this is executed on save.

 

would you be so kind to share the project/source code afterwards so if there are changes needed i can make them myself?

 

Thank you!

 

Best regards

 

SyntaxEditor Code Snippet

Sub Main()
Dim IPJ as String
Dim IPJ_Name As String
Dim IPJ_Path As String
Dim FNamePos As Long
'set a reference to the FileLocations object.
IPJ = ThisApplication.FileLocations.FileLocationsFile

If IPJ = "C:\VLT_Wrk\Konstruktion.ipj" Then

 Dim odoc As Document = ThisDoc.Document
Dim eDocumentType As DocumentTypeEnum = odoc.DocumentType

     Select Case eDocumentType
            Case DocumentTypeEnum.kAssemblyDocumentObject 
                Vaultpropwriteback(odoc)
		Propcheckdes(odoc, 1)
                
             Case DocumentTypeEnum.kDrawingDocumentObject 
                 Vaultpropwriteback(odoc)
                
            Case DocumentTypeEnum.kPartDocumentObject 
		Vaultpropwriteback(odoc)
                Propcheckdes(odoc, 2)
			
      End Select
	  
	  End If 
	  
End Sub
    
    ''''--------------------------------------''''

Sub Vaultpropwriteback(odoc As Inventor.Document)
	
	'' EXECUTE THIS LINE ONLY IF THE FILE EXISTS IN VAULT!
	
     ThisApplication.CommandManager.ControlDefinitions.Item("VaultPropertyWriteBack").Execute
   
 
End Sub
    
    

Sub Propcheckdes(oDoc As Inventor.Document, filetype As Integer)
Dim counter As Integer = 0
Dim Desc as String
Dim opened As Boolean = False
Dim alreadyopen As Boolean = False
Desc = iProperties.Value(“Project”, “Description”)
Dim odoc2 As Inventor.PartDocument
Dim odoc3 As Inventor.AssemblyDocument


''see if file is already open

	For Each d As Document In ThisApplication.Documents.VisibleDocuments
		If d.FullFileName = oDoc.FullFileName Then
			alreadyopen = True
		End If
	Next

	''restore active window
	Dim odocactive As Inventor.Document
	odocactive = ThisApplication.ActiveDocument

	If String.IsNullOrWhiteSpace(Desc) = True Then
		If filetype = 1 Then
			odoc3 = ThisApplication.Documents.Open(oDoc.FullFileName, True)
		Else
			odoc2 = ThisApplication.Documents.Open(oDoc.FullFileName, True)
		End If
		opened = True
	End If

	Do Until String.IsNullOrWhiteSpace(Desc) = False Or counter > 0
		iLogicForm.ShowGlobal("Pflichtfelder",FormMode.Modal)
		Desc = iProperties.Value(“Project”, “Description”)
		counter = counter + 1
	Loop

	If opened And Not alreadyopen Then
		If filetype = 1 Then
			odoc3.Close(True)
		Else
			odoc2.Close(True)
		End If	
	End If

	odocactive.Activate
	
End Sub

 

0 Likes
Message 30 of 33

marcin_otręba
Advisor
Advisor
Accepted solution

Hi,

 

Try this:

 

If ThisApplication.CommandManager.ControlDefinitions.Item("VaultDataCardtop").Enabled = True And 

   ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckouttop").Enabled = True Then
      

      Debug.Print "in vault(not checked out) check out possible"


End If


If ThisApplication.CommandManager.ControlDefinitions.Item("VaultDataCardtop").Enabled = True And

   ThisApplication.CommandManager.ControlDefinitions.Item("VaultUndoCheckouttop").Enabled = True Then
           

       Debug.Print "in vault checked out"

 

End If


If ThisApplication.CommandManager.ControlDefinitions.Item("VaultDataCardtop").Enabled = True And

   ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckouttop").Enabled = False And 

   ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckintop").Enabled = False Then
       

           Debug.Print "in vault locked (not possible to check out)"

 

End If

 

If ThisApplication.CommandManager.ControlDefinitions.Item("VaultDataCardtop").Enabled = False Then
      

          Debug.Print "not in vault"
       

End If,

 

 

i used it this way before switching to vb.net

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

Message 31 of 33

Anonymous
Not applicable

may i kiss you??? 😄

 

works like a charm! thank you very much!

0 Likes
Message 32 of 33

marcin_otręba
Advisor
Advisor

you're welcome mate

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 33 of 33

bradeneuropeArthur
Mentor
Mentor

@marcin_otręba

 

Without any complexity.

My compliments.

 

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