Vault Data Standard Search with 2 properties

Vault Data Standard Search with 2 properties

Anonymous
Not applicable
642 Views
1 Reply
Message 1 of 2

Vault Data Standard Search with 2 properties

Anonymous
Not applicable

Hello,

 

I have implemented Vault DataStandard on my computer and I'm trying to modify it to fit my company needs.

 

With VDS, I can prevent using the same Part Number, which is great, but the problem is that I also need to have the possibility to use the same PN for differenttype of file.

 

For example, I have a part (.ipt) or an assembly (.iam) which is already in Vault, but now, I need to create the drawing of this part/assembly.

Part --> 123-45678 - Example.ipt

 

I need to have :

Drawing --> 123-45678 - Example.idw

 

In The VDS "Default.ps1" code, I have seen that the search in Vault is made using "FindFilesBySearchConditions".

Is there a way to search with 2 conditions?

 

function PartNumberChanged
{
$srchCond = New-Object Autodesk.Connectivity.WebServices.SrchCond[] 1
$srchCond[0] = New-Object Autodesk.Connectivity.WebServices.SrchCond
$srchCond[0].PropDefId = 88
$srchCond[0].SrchOper = 3
$srchCond[0].SrchTxt = $Prop['Part Number'].Value
$srchCond[0].PropTyp = "SingleProperty"
$srchCond[0].SrchRule = "Must"
$bookmark = ""
$status = New-Object Autodesk.Connectivity.WebServices.SrchStatus
$files = $vault.DocumentService.FindFilesBySearchConditions($srchCond,$null,$null, $false, $true, [ref]$bookmark, [ref]$status)
if($files -ne $null) { [System.Windows.Forms.MessageBox]::Show("Part number already exists!!!!","Wrong part number",[System.Windows.Forms.MessageBoxButtons]::OK,[System.Windows.Forms.MessageBoxIcon]::Error) }
}

 

In advance, thank you for your help on this.

 

0 Likes
643 Views
1 Reply
Reply (1)
Message 2 of 2

wangdu
Collaborator
Collaborator

Hi,

 

This is possible with Vault FindFilesBySearchConditions API and here is the link that I found. You can search with more than one property.

 

Basically, you will need to add another SrchCond on FileName property. I found this link which actually is an UI example for searching extensions inside the FileName property.

 

Hope it helps!

 

Wangdu

 

coolOrange

www.coolOrange.com

0 Likes