Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vault Data Standard 2020 - Powershell Error - GetFolderByPath

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
nkirton
2036 Views, 6 Replies

Vault Data Standard 2020 - Powershell Error - GetFolderByPath

Good afternoon everyone,

I recently started testing Vault Data Standards to add it to our Vault/Inventor environment in the office, but ran into a problem. When saving a file, I am presented with this message.

 

Capture.JPG

 

 

 

 

 

 

 

 

 

 

 



Now, I have been researching and looking over what could be the problem but I am well and truly stuck. I have googled and found other issues related to the BOM, but this is not that.

I have made sure that both my Inventor and Vault are on the latest or same versions.
I found that this only happens when I have a Vault Project file active vs. a single user project. I thought maybe it's due to it's read only state, but that does not change anything. 


It's still functional other than the fact that I don't have the folder select tab available above.


Capture 2.JPG

 

 

 

 

 

 

 

 

 

 

 

If anyone knows of his error or if you could help in any way, I would really appreciate it!

Thanks!

Nathan Kirton


If what I said helped you out, please use the ACCEPT AS SOLUTION or KUDOS buttons.


"I don't know why it doesn't work. It fit in the model!"

Labels (1)
6 REPLIES 6
Message 2 of 7
nkirton
in reply to: nkirton

What I do see, is if my project file's Vault Options has the Virtual Folder as just blank, it all works great.

blank.JPG

 

 

 

 

 

 

 


But then because it's blank, Inventor does not know where the workspace is.

not mapped.JPG

 

 

 

 

 

 

 

Nathan Kirton


If what I said helped you out, please use the ACCEPT AS SOLUTION or KUDOS buttons.


"I don't know why it doesn't work. It fit in the model!"

Message 3 of 7
wangdu
in reply to: nkirton

Hi,

 

This error dialog is displayed because you don't have any folders in the vault under the root folder. Create some folders in the vault and then the dialog will not be displayed.

 

Hope it helps!

 

Wangdu

ccolOrange

Message 4 of 7
nkirton
in reply to: wangdu

Good morning,

Thank you so much for the reply. Unfortunately I do have folders under the root directory inside Vault already 😕

FOlders.JPG

 

 

 

 

 

 

 

 

 

I will work on this more and see what else I can gather over the weekend. I was able to modify the default.ps1 to where the error does not show up, but then it doubles up my working folder.

function GetVaultRootFolder()
{
$mappedRootPath = $Prop[""VaultVirtualPath"].Value + $Prop["."].Value
$mappedRootPath = $mappedRootPath -replace "\\", "/" -replace "//", "/"
if ($mappedRootPath -eq '')
{
$mappedRootPath = '$'
}
return $vault.DocumentService.GetFolderByPath($mappedRootPath)
}
double.JPG






 

 

 



Do you think I need to arrange my working folder differently?

I'm sure my editing of the code is not the right way, but that's what I've been trying.

Thanks again for the help.


Nathan Kirton


If what I said helped you out, please use the ACCEPT AS SOLUTION or KUDOS buttons.


"I don't know why it doesn't work. It fit in the model!"

Message 5 of 7
wangdu
in reply to: nkirton

Hi,

 

If the vault has folders then this error dialog should not appear. As for the other changes you are doing in the script, it depends on what you want to achieve. Normally, setting up the inventor vault project 'correctly' should suffice.

 

Wangdu

Message 6 of 7
nkirton
in reply to: wangdu

Hey again,

I double checked my Project file to make sure it's set up right. If I missed something, I am not sure, but I think I have it right.

I may have just forced my way through the code and got to what I needed.

The only change I made was this.

function GetVaultRootFolder()
{
$mappedRootPath = $Prop["_VaultVirtualPath"].Value + $Prop["_WorkspacePath"].Value
$mappedRootPath = $mappedRootPath -replace "\\", "/" -replace "//", "/"
if ($mappedRootPath -eq '')
{
$mappedRootPath = '$'
}
return $vault.DocumentService.GetFolderByPath("$/AUC Data") - previously was ($mappedRootPath)
}

By forcing the folder lookup or the "Get Folder" to look inside my "AUC Data" folder instead of just inside the root folder, I have what I need.

It allows the User to select the folders directly inside the "AUC Data" file, and will stop it from doubling up the folder as I previously pointed out.

solved.JPG

 



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


This is more than likely user error on my part, as I am still learning Vault, and have no clue how code works, but at least this is a fix for me for now.

Thank you again for your help. I will mark this comment as a "solution".

Nathan Kirton


If what I said helped you out, please use the ACCEPT AS SOLUTION or KUDOS buttons.


"I don't know why it doesn't work. It fit in the model!"

Message 7 of 7
BeasterlyJEC92
in reply to: nkirton

Hey, I also just got this same error setting up a new vault. Mine was caused by being logged into a different vault in inventor than the one I was trying to set up. Posting here in case anyone has the same problem. 

 

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

Post to forums  

Autodesk Design & Make Report