Vault Datastandard $DSParam empty?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have learned, that if you click on the "OK" button in a DataStandard dialog, that the OnPostCloseDialog function will be executed.
Depending if you are saving or editing a DataStandard part, hitting the "OK" button, should also give the $DSParam the value "Create" or Ëdit".
Depending on this value, the OnPostCloseDialog can generate a new/first filename, or not (if you already have saved the file).
The next peace of code shows the OnPostCloseDialog part.
If it is an Inventor file, then the code looks if the $DSParam has the value "Create" and only than, it will generate a new filenumber.
If it is not (you are editting an already saved file) no new number has to be generated.
function OnPostCloseDialog { $mWindowName = $dsWindow.Name switch($mWindowName) { "InventorWindow" { if ($DSParam -eq "Create") { #CODE for generating partnumber } } } }
The strange thing is, that my DataStandard will never go in the partn muber generating code. For some reason, the $DSParam seems to get no value at all.
Is this something I have to create somewhere else in the code myself, or should this parameter get the value by a hardcoded peace of code?
Oh, the "OK" button is binded:
<Button Name="btnok" Command="{Binding CloseWindowCommand, ElementName=InventorWindow}" Grid.Column="1" Margin="0,5,0,5" Width="80" HorizontalAlignment="Right" VerticalAlignment="Center" ToolTipService.ShowOnDisabled="True" ToolTip="{Binding UIString[LBL35]}" Content="{Binding UIString[BTN1]}" IsEnabled="{Binding Properties.IsValid}"></Button>