Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

3 REPLIES 3
Reply
Message 1 of 4
zoe.baker-bushby
164 Views, 3 Replies

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

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 🙂

Labels (4)
3 REPLIES 3
Message 2 of 4

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
Message 3 of 4

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?

Message 4 of 4

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report