Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Is there any way of using iLogic to Copy Design a Vault file into a specific location?

zoe.baker-bushby
Enthusiast
Enthusiast

Is there any way of using iLogic to Copy Design a Vault file into a specific location?

zoe.baker-bushby
Enthusiast
Enthusiast

I am familiar with the new Vault iLogic snippets and have managed to get this snippet to at least copy the file:

'set new file name according your requirements. Use snippet including auto-numbering if no individual file name applies.
Dim mNewFileName As String = "Test" 'replace unique ID by your naming configuration, e.g. sequence of f(x) key parameter values

'returns full file name in local working folder (download enforces override, if local file exists)
'returns "FileNotFound" if file does not exist at indicated location
Dim mVaultFile As String = iLogicVault.GetFileCopyBySourceFileNameAndNewName("$/08 - MISCELLANEOUS/08.01 - FIXINGS/08.01.02 - ANCHORS/BASIC ANCHOR.ipt", mNewFileName, True,) 'optionally add the mNumInput variable; note - new file name must not contain an extension! The CheckOut option is True as default; set to False or remove.
If mVaultFile Is Nothing Then
	Logger.Error("File copy not created; validate source file can be found and new file name." )
Else
	Logger.Info("File " & mVaultFile & " created As copy.")
		'add next action using the downloaded file here, e.g. Component.Replace("Part1:1", mVaultFile, True)
End If

It puts the new file in the same location as the original.

However if it is possible I would like the new file to be put elsewhere...?

 

Is it possible?

We're only scoping out ideas for a new workflow so any input would be greatly appreciated 🙂

0 Likes
Reply
307 Views
3 Replies
Replies (3)

A.Acheson
Mentor
Mentor

Hi @zoe.baker-bushby

 

I don’t have vault so really just understanding what your looking to change or receive help with. Do you want to just change part of the filepath string by splitting it and receiving new input?Can you give an example of your new location filepath?

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes

zoe.baker-bushby
Enthusiast
Enthusiast

If in anyway this:

iLogicVault.GetFileCopyBySourceFileNameAndNewName("$/08 - MISCELLANEOUS/08.01 - FIXINGS/08.01.02 - ANCHORS/BASIC ANCHOR.ipt", mNewFileName, True,)

Can change to something along the lines of:

iLogicVault.GetFileCopyBySourceFileNameAndNewName("PATH OF FILE TO COPY", mNewFileName, "PATH TO LOCATE THE NEW FILE" True,)

 Being able to specify the new location would greatly help one of our new workflows.

Currently it automatically copies the file into the same file location as the original.

 

Is it possible?

Does it need handling by a separate operation that specifically allows iLogic to 'move' vault files?

A.Acheson
Mentor
Mentor

I see the issue you have, the function your using has only two arguments the existing path and the new filename.I can see no function in the 

ilogicvaultclass help page shown here that will directly suit your needs. You might have do copy locally and check into the new location in vault. So lots of extra steps. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes