Check-in Vault in invisible document

Check-in Vault in invisible document

m_baczewski
Advocate Advocate
403 Views
3 Replies
Message 1 of 4

Check-in Vault in invisible document

m_baczewski
Advocate
Advocate

Hello,

 

I am implementing a device configurator where we provide all the parameters for the device, and then a new model is created along with new drawings and changes to individual references to elements that are part of this assembly. In the end, I would like to save the new assembly along with its parts and drawings to the vault.

Previously, I did this using the following code:

 

Dim oControlDef As Inventor.ControlDefinition
oControlDef = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop")
oControlDef.Execute()

But at this point, operations on the new model and new drawings take place in invisible mode, for example:

oDraw =ThisApplication.Documents.Open(newDrawingPath + idwExtension, False) 
oDraw.ReferencedDocumentDescriptors.Item(1).ReferencedFileDescriptor.ReplaceReference(newDrawingPath & extension)
oDraw.Save()

Is it possible to save individual elements without using the CommandManager?

0 Likes
404 Views
3 Replies
Replies (3)
Message 2 of 4

charles4L34S
Contributor
Contributor

Hi @m_baczewski,

 

I have a similar process, I create a drawing sheet and export it as PDF and DWG, then add all files to vault without needing the user to manually check-in the files.

 

I use the iLogicVault.AddFile to perform a "dumb" check-in of resultant drawings without needing user intervention, I am not sure if this would work in invisible mode, as my drawing relies on being visible for other rules. As noted in the snippet description, this can't do the parent/child relationships between parts/assemblies. For me this isn't an issue, but that doesn't look like it will be the case for you. The "parent document" just adds the files as attachments.

 

The snippet library is available on the authors github,

koechlm/iLogic-Vault: iLogic Rules, Snippets and iLogic-Vault Quickstart library (github.com)

0 Likes
Message 3 of 4

m_baczewski
Advocate
Advocate

Hi,

Thank you for your response. I had already found a solution using iLogicVault.AddFiles, but I would like all drawings and models, along with their components, to be associated with each other. I don't want them to lose their references, which happens in the case of iLogicVault.AddFiles.

So, is there no way to eliminate the CommandManager and write the model and then drawings through the Inventor API?

0 Likes
Message 4 of 4

g.georgiades
Advocate
Advocate

@m_baczewskiYou can check in files using just straight vault API code, but it is not a simple process

The challenge is building up the file associations from the bottom up essentially one at a time since you must have the children uploaded before the parent to build the associations.

 

There are a few forum posts here that may help you where others attempting to pull off the same feat.

https://help.autodesk.com/view/VAULT/2024/ENU/?query=addfile

 

The vault API functions you are looking for are AddFile for new files and CheckinFile for existing files that are checked out. You may want the AddFileWithBehavoirs method. Not sure what it does, maybe copies permissions or lifecycle stuff?

ggeorgiades_0-1705666416976.png

 

Personally I would experiment more with command manager - instead of opening the files with the hidden flag, maybe opening them visible, but turning off screen updating will provide the functionality you need? I know using checkintop requires inventor's focus, otherwise it will show the dialog to the user, but I don't know how it interacts with screen updating off.

https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=Application_ScreenUpdating

 

0 Likes