Hello,
Sorry, but I don't know anymore.
In the selection of numbering schemes in Vault and Inventor VDS, only the default scheme appears.
How do I get the default scheme to be the first selection but all other activated schemes are selectable?
I have this code from Vault 'GetNumSchms' from VDS-MFG-Sample 2025:
$_FilteredNumSchems = $numSchems | Where-Object { $_.IsDflt -eq $true }
$Prop["_NumSchm"].Value = $_FilteredNumSchems[0].Name
$dsWindow.FindName("NumSchms").IsEnabled = $false
return $_FilteredNumSchems
Many thanks
Solved! Go to Solution.
Solved by Nick_Hall. Go to Solution.
Solved by Markus.Koechl. Go to Solution.
Hi Paula
It's probably not the most efficient way, but I'd do it like this:
$_FilteredNumSchems = New-Object System.Collections.ArrayList($null)
$defaultNumSchem = $numSchems | Where-Object { $_.IsDflt -eq $true }
$_FilteredNumSchems.Add($defaultNumSchem) | Out-Null
foreach($numSchem in $numSchems) {
if ($numSchem.SchmID -ne $defaultNumSchem.SchmID) {
$_FilteredNumSchems.Add($numSchem) | Out-Null
}
}
return $_FilteredNumSchems
I've not tested the code, but it *should* move the default scheme to the top of the list. And it needs a bit of error trapping too.
Hope it helps
Nick
You can activate the default scheme while returning all instead of the filtered ones:
$_default = $numSchems | Where-Object { $_.IsDflt -eq $true }
$Prop["_NumSchm"].Value = $_default.Name
return $numSchems

Hi Paula
The approach I suggested in my original reply will put the default at the top of your list.
You should be able to combine it with Markus' code to select the default.
Nick
Hi again
I had to test my theory. This code will return the numbering schemes, in alphabetical order, but with the default moved to the top of the list
$numSchems = $numSchems | Sort-Object -Property Name
$_OrderedNumSchems = New-Object System.Collections.ArrayList($null)
$defaultNumSchem = $numSchems | Where-Object { $_.IsDflt -eq $true }
$_OrderedNumSchems.Add($defaultNumSchem) | Out-Null
foreach($numSchem in $numSchems) {
if ($numSchem.SchmID -ne $defaultNumSchem.SchmID) {
$_OrderedNumSchems.Add($numSchem) | Out-Null
}
}
$numSchems = $_OrderedNumSchemsLike I said earlier, I'm sure it could be more efficient
Nick
Can't find what you're looking for? Ask the community or share your knowledge.