iLogic CheckOut from Vault

iLogic CheckOut from Vault

Nejc.Leban
Advocate Advocate
4,907 Views
21 Replies
Message 1 of 22

iLogic CheckOut from Vault

Nejc.Leban
Advocate
Advocate

Greetings everyone.

 

I have spent a while trying to find a solution to my problem, but to no avail.

 

I would like to know if it's possible to automatically check out certain files in an assembly.

I know how to cycle through the files that need to be checked out, I just can't figure out how to check them out from vault.

I'm using Inventor Pro 2021 and Vault Basic.

Does anyone know the command for checking out files with iLogic?

 

Thank you.

Best regards,

Nejc

Accepted solutions (1)
4,908 Views
21 Replies
Replies (21)
Message 2 of 22

theo.bot
Collaborator
Collaborator

There is a snippet library that can be used: iLogic and Vault—Vault and iLogic | Autodesk University

 

theobot_0-1643193239133.png

 

 

Message 3 of 22

Nejc.Leban
Advocate
Advocate

Unfortunately this doesn't work for me:

oControlDef = oApp.CommandManager.ControlDefinitions.Item("VaultCheckoutTop")
oControlDef.Execute2(True)

 

"VaultCheckoutTop" wants to check out all the files in the assembly and the assembly itself. I just want to check out certain parts of the assembly.

 

I thank you for sharing that link though, I think I'll be able to find lots of useful commands there.

Message 4 of 22

JBerns
Advisor
Advisor

@theo.bot,

 

Do you know if the snippet library is compatible with Vault Basic?

Currently using 2019, but will be upgrading soon.

 

Regards,

Jerry 

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
0 Likes
Message 5 of 22

theo.bot
Collaborator
Collaborator

@JBerns ,

 

Automation will only work for Vault professional or Vault Workgroup. So With Vault Basic you can't use the ilogic Quickstart library. 

Codes using the CommandManager will work because it's the same as hitting the button in inventor.

0 Likes
Message 6 of 22

Nejc.Leban
Advocate
Advocate

@theo.bot 

How would I then check out a single part from the assembly using iLogic?

Like This:

NejcLeban_0-1645166122387.png    NejcLeban_2-1645166190616.png

Like I said, "VaultCheckOutTop" tries to check out the whole assembly, I would like to only check out certain parts in that assembly. If "VaultCheckOutTop" opens a window like the above picture (but for the whole assembly), how do I do it for a single part (like in the pictures) and what's the command for pressing the OK button?

 

 

 

 

Message 7 of 22

theo.bot
Collaborator
Collaborator

You could open the part in a new window to check it out and close the window. I tested it and it works, but with a large number of parts it could take up some time. 

 

Dim oControlDef As ControlDefinition
Dim oDoc As Document
ThisApplication.ScreenUpdating = False
'open part file
oDoc = ThisApplication.Documents.Open("D:\01 Data\Workingfolder Vault\Designs\Projects\P112 - Aska\Parts\200-363.ipt",True )
oDoc.Activate

oControlDef = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckoutTop")
oControlDef.Execute2(True)

oDoc.Close

ThisApplication.ScreenUpdating  = True

 

theobot_0-1645167848569.png

 

0 Likes
Message 8 of 22

Nejc.Leban
Advocate
Advocate

Yeah, I've actually tried that and it worked for me as well, but the problem is, like you said, the number of parts. I sometimes have big weldments, consisting of 100 parts.

What about the OK button, how do I get iLogic to "press" the OK button?

0 Likes
Message 9 of 22

theo.bot
Collaborator
Collaborator

show me a screenshot. is it the check out dialog? I always have them suppressed, because in 99% of the cases i just need to hit OK . you can set this in vault options (on the ribbon vault):

theobot_0-1645168590328.png

 

0 Likes
Message 10 of 22

Nejc.Leban
Advocate
Advocate

Yeah, it's this window.

NejcLeban_0-1645172732304.png

I wouldn't like having it suppressed, is there a way for iLogic to "press" the OK button?

0 Likes
Message 11 of 22

Nejc.Leban
Advocate
Advocate
Accepted solution

OK for anyone who might need this, I've found a solution. It selects all parts with the same part of the name as the assembly and checks out those parts:

 

' Get the active assembly. 
Dim oAsmDoc As AssemblyDocument = ThisDoc.Document
oAsmname = oAsmDoc.DisplayName

' Check for a non-part document
If oAsmDoc.DocumentType <> kAssemblyDocumentObject Then
    MsgBox ("The Active document must be an 'Assembly'!")
    GoTo Error
End If

For Each oRefDoc As ComponentOccurrence In oAsmDoc.ComponentDefinition.Occurrences
	oFilename = oRefDoc.Definition.Document.Displayname
	If Left(oFilename, Len(oFilename) -3) = Left(oAsmname, Len(oAsmname) -3)
		ThisApplication.CommandManager.DoSelect(oRefDoc)
	End If
Next

ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckout").Execute2(False)
System.Windows.Forms.SendKeys.SendWait(Chr(9) & vbCrLf)		'TAB to switch to OK button and press ENTER.

Error :

 

Regards,

Nejc

 

 

Message 12 of 22

christoph.rennertz
Observer
Observer
Hi Theo,

could you please repost the library with the snippets. On the link you sent the library is gone.

Many thanks,

Christoph
0 Likes
Message 13 of 22

theo.bot
Collaborator
Collaborator

@christoph.rennertz 

 

In the handout is the link to the original library. But here's the direct link: Release iLogic-Vault | iLogic-VaultInventorServer 2023 · koechlm/iLogic-Vault · GitHub

Message 14 of 22

fshzhu04
Participant
Participant

@theo.bot 

Hello Bot, I'm using this library and it works well for me, but sometimes this code can't download the related drawing from Vault only the ipt model, even the Log print the IDW has downloaded, but there is no drawing file in this working folder.  Do you know why? Thank you!

 

fshzhu04_0-1668410933791.png


@theo.bot wrote:

@christoph.rennertz 

 

In the handout is the link to the original library. But here's the direct link: Release iLogic-Vault | iLogic-VaultInventorServer 2023 · koechlm/iLogic-Vault · GitHub


 

Message 15 of 22

theo.bot
Collaborator
Collaborator

@fshzhu04 , 

 

Sorry, I don't no why. @Markus.Koechl can you help with this question? 

0 Likes
Message 16 of 22

Markus.Koechl
Autodesk
Autodesk

@fshzhu04: could you share the steps to reproduce? I am unsure what you are trying to achieve and how you are trying it.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 17 of 22

fshzhu04
Participant
Participant

@Markus.Koechl wrote:

@fshzhu04: could you share the steps to reproduce? I am unsure what you are trying to achieve and how you are trying it.


Hello Koechl,

 

I just use the "iLogicVault_GetFileBySearch" sample rule, and only change the parameter which apply to my Vault, and then run the code but could not get the related IDW drawing, only the IPT model and the Log present the IDW has downloaded.

0 Likes
Message 18 of 22

Markus.Koechl
Autodesk
Autodesk

The method does not include drawing documentation files or parent assemblies. It includes files that are necessary to open the file properly. E.g., the drawing of a part file requires the part file, and assemblies need their sub-components. This video illustrates the sample rule: https://youtu.be/h0KUj-PNRaI



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 19 of 22

fshzhu04
Participant
Participant

Hello Koechl,

 

Thanks for your reply, unfortunately I can't open the video link. Mostly when I use the "iLogicVault_GetFileBySearch" code, it can download the models and it's releated IDW most of the time (I use the same parameter texts for search), but some of IDW couldn't download even the log prentent it has done. It is strange to me why some IDW can download correctly and some of them couldn't.

0 Likes
Message 20 of 22

Markus.Koechl
Autodesk
Autodesk

"Dependent" does not mean the drawing documentation file. The code behind all Get* methods does not include drawing documentation rather than dependents, e.g., an assembly depends on its parts and will download these. So, I wonder why you get drawings if you don't explicitly search for them, e.g., "Name" "100002.IDW".



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes