Best practice different numbering schemes for categories - Vault Data Standard

Best practice different numbering schemes for categories - Vault Data Standard

-Roland-
Advocate Advocate
2,384 Views
7 Replies
Message 1 of 8

Best practice different numbering schemes for categories - Vault Data Standard

-Roland-
Advocate
Advocate

Hello experts,

 

what is the best practice different numbering schemes for categories.

For example:

category "Engineering" - number schemes "E1" + "E2" + "E3"

category "Engineering2" - number schemes "E3"+"E4"

category "Office" - number schemes "O1" + "O2"

 

We uses Vault pro 2020 with Datastandard "VDS-Quickstart-2021"

 

I testet it with the "function GetNumSchms" in ADSK.QS.Default.

 

Filter the NumSchems with $allowedNumSchemes works. But what is the best practice to filter it for categories.

 

 

$allowedNumSchemes = @('Konstruktion_Auftragsbezogen','Konstruktion','Bestandskonstruktion','Freigabezeichnungen')
$_FilteredNumSchems = @()
Foreach ($numScheme in $numSchems){
if($allowedNumSchemes -contains $numScheme.Name){
$_FilteredNumSchems += $numScheme
$_FilteredNumSchems = $_FilteredNumSchems | Sort-Object -Property IsDflt -Descending
return $_FilteredNumSchems

 

 

 

 

Works at start but when not when i change the category.

 

 

if ($Prop["_Category"].Value -eq "Konstruktion"){
$allowedNumSchemes = @('Freigabezeichnungen')}
else
{$allowedNumSchemes = @('Bestandskonstruktion')}

 

 

 

 

 

The Prob"Beschreibung" works when i change the category, but $allowedNumSchemes dosen´t work.

 

 

$Prop["_Category"].add_PropertyChanged({
If($Prop["_Category"].Value -eq "Konstruktion") 
	{
$Prop["Beschreibung"].Value = "Engineering Document"
$allowedNumSchemes = @('Freigabezeichnungen')
}
Else
{
$Prop["Beschreibung"].Value = "Non-Engineering Document"
$allowedNumSchemes = @('Bestandskonstruktion')
}
})

 

 

 

Does anyone have any idea how to solve the problem easiest?

 

Roland

 

 

 

 

0 Likes
Accepted solutions (1)
2,385 Views
7 Replies
Replies (7)
Message 2 of 8

Markus.Koechl
Autodesk
Autodesk

I did not test in detail, but the first thing you need to check is that the pull-down list of numbering schemes refreshes its content. As a default, the Quickstart sample explicitly loads the schemes only one time:

ItemsSource="{Binding PsList[GetNumSchms], Mode=OneTime}"

If you refresh a filtered list of numbering schemes, I suggest loading all themes one time to a $global:_MyNumSchms variable. Create another function to filter the global list to the list required in the current context. This avoids additional server calls during the run time of your dialog.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
Message 3 of 8

-Roland-
Advocate
Advocate

Hello Markus,

 

thank you for your answer.

 

 

<ComboBox x:Name="NumSchms" Grid.Column="1" Grid.Row="3"
                      SelectedIndex="0"
                      DisplayMemberPath="Name"
                      SelectedValuePath="Name"
                      SelectedValue="{Binding Prop[_NumSchm].Value}"
                      ItemsSource="{Binding PsList[GetNumSchms], Mode=OneTime}"
                      IsEnabled="{Binding HasItems, RelativeSource={RelativeSource Self}}"
                      Visibility="{Binding NotEditMode, Converter={StaticResource BooleanToVisibilityConverter}}"

 

The binding mode is "OneTime".

I've already tested with other modes, but this causes Vault to crash.

 

We have 8 different categories and 6 different numbering schemes and depending on the category 1-4 of these should be available.

 

I am now quite sure what you mean. Should I create a $ global: _MyNumSchms with all number schemas, and then filter it in a function depending on the category?

 

 

0 Likes
Message 4 of 8

-Roland-
Advocate
Advocate

I have a problem that the NumShems list is not updated, when I change the category in the standard dialog box.

 

function InitializeWindow
{
#begin rules applying commonly
$Prop["_Category"].add_PropertyChanged({
if ($_.PropertyName -eq "Value")
{
#region quickstart
#$Prop["_NumSchm"].Value = $Prop["_Category"].Value
allowedNumSchemes
m_CategoryChanged
#endregion
}

 

function GetNumSchms
{
if ($Prop["_CreateMode"].Value)
{
try
{
#Adopted from a DocumentService call, which always pulls FILE class numbering schemes
[System.Collections.ArrayList]$numSchems = @($vault.NumberingService.GetNumberingSchemes('FILE', 'Activated'))

if ($numSchems.Count -gt 1)
{
#$numSchems = $numSchems | Sort-Object -Property IsDflt -Descending
#region Quickstart
$mWindowName = $dsWindow.Name
switch($mWindowName)
{
"FileWindow"
{
#$_FilteredNumSchems = $numSchems | Where { $_.IsDflt -eq $true}
#$Prop["_NumSchm"].Value = $_FilteredNumSchems[0].Name
#$dsWindow.FindName("NumSchms").IsEnabled = $true
#return $_FilteredNumSchems

$_FilteredNumSchems = @()
Foreach ($numScheme in $numSchems){
if($global:_MyallowedNumSchemes -contains $numScheme.Name){
$_FilteredNumSchems += $numScheme
}
}
$_FilteredNumSchems = $_FilteredNumSchems | Sort-Object -Property IsDflt -Descending

return $_FilteredNumSchems

 

 

function allowedNumSchemes
{
if($prop["_Category"].Value -eq "Office"){

$global:_MyallowedNumSchemes = @('Office')

}

if($prop["_Category"].Value -eq "Konstruktion"){

$global:_MyallowedNumSchemes = @('Freigabezeichnungen' , 'Konstruktion','Office')

}

if($prop["_Category"].Value -eq "Zeichnungsableitungen"){

$global:_MyallowedNumSchemes = @('Bestandskonstruktion')

}

if($prop["_Category"].Value -eq "Freigabezeichnungen"){

$global:_MyallowedNumSchemes = @('Freigabezeichnungen')

}
}

 

Does anyone have a good idea for a solution?

 

0 Likes
Message 5 of 8

Markus.Koechl
Autodesk
Autodesk
Accepted solution

In general, I strongly believe, that having a single numbering scheme providing unique file names is the best practice. That's my personal experience and view, based on the trouble and efforts that I see customers struggling with.

However, I respect that many think differently. The Quickstart configuration sample that you are using is prepared to activate a numbering scheme per category. It is much simpler than you tried.

Load all available numbering schemes; to do this, you need to remove the filters in GetNumSchms like this:

function GetNumSchms
{
	if ($Prop["_CreateMode"].Value)
	{
		try
		{
			#Adopted from a DocumentService call, which always pulls FILE class numbering schemes
				[System.Collections.ArrayList]$numSchems = @($vault.NumberingService.GetNumberingSchemes('FILE', 'Activated'))

			if ($global:numSchems.Count -gt 0)
			{
				#region Quickstart
					$mWindowName = $dsWindow.Name
					switch($mWindowName)
					{
						"FileWindow"
						{				
							return $numSchems 
						}
...

The category-changed-event can activate the required one (I added 2 schemes in my environment: "File-Item and "Sequential Files"): 

function m_CategoryChanged 
{
	$mWindowName = $dsWindow.Name
    switch($mWindowName)
	{
		"FileWindow"
		{
			#Quickstart uses the default numbering scheme for files; GoTo GetNumSchms function to disable this filter incase you'd like to apply numbering per category for files as well
			If ($Prop['_XLTN_AUTHOR'])
			{
				$Prop['_XLTN_AUTHOR'].Value = $VaultConnection.UserName
			}

			#activate numbering scheme according to selected category
			if($prop["_Category"].Value -eq "Office")
			{ 
				$Prop["_NumSchm"].Value = "Sequential Files"
			}
			else
			{
				$Prop["_NumSchm"].Value = "File-Item"
			}
			$dsWindow.FindName("NumSchms").Text = $Prop["_NumSchm"].Value
		}
....

😉 Should I move the comment to another location? Honestly, I did not recall that I already posted a note, how to do this in the code: #Quickstart uses the default numbering scheme for files; GoTo GetNumSchms function to disable this filter in case you'd like to apply numbering per category for files as well.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
Message 6 of 8

-Roland-
Advocate
Advocate

Thank you for your prompt reply
I set the thread to resolved because I can live with the solution like this. Unfortunately, filtering NumShems does not work as requested.
When selecting the category, the desired standard numbering scheme is selected as desired.

 

If the numbering scheme is changed, all numbering schemes are available.
For example in the category construction only "Konstruktion", "Bestandskonstruktion" and "Konstuktion_Auftagsbezogen" should be available and in the category office only numbering scheme "Office" should be available.

 

I can use the "allowedNumSchemes" function to assign the numbering schemes. It works but only once.

When changing the category, the variable "$ global: _MyallowedNumScheme" is updated,

but "$ _FilteredNumSchems" and "$ NumSchems" are not updated.

 

 

 

Roland

0 Likes
Message 7 of 8

Markus.Koechl
Autodesk
Autodesk

@-Roland-: As part of the new VDS Tutorial, Chapter 11 is dedicated to your question. It uses a different approach compared to Quickstart and should offer the flexibility that you are asking for. Check out here: https://knowledge.autodesk.com/community/article/312276



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 8 of 8

-Roland-
Advocate
Advocate

Hi @Markus.Koechl ,

 

i've been following her "Vault Data Standard - Tutorial" for a long time.
I looked at chapters 10 and 11 yesterday evening.
I will optimize our workflow "Numbering Schemes" again.
Thanks for the well done Vault Data Standard tutorial I can only recommend to everyone.
At the moment I am still hanging on another problem "Only Number for Textboxes" but that is another topic. 

 

Best regards

 

Roland

0 Likes