Example–Setting Title Property Values in a Data Standard Dialog
If you want to set title properties before the Data Standard Dialog first displays, you can add code within the InitializeWindow
function.
Set the Property Title
Set the value of the property you are looking for with the desired.
function InitializeWindow
{
$Prop["Title"].Value = "my title"
}
Set a Title Property for the File Dialog Only (Vault Client)
If you want to set a property title only for the file dialog and not for other dialogs, such as folder or custom object, specify the dialog name of the $dsWindow
.
function InitializeWindow
{
if ($dswindow.name--eq-"filewindow")
{
$Prop["Title"].Value = "my title"
}
}
Set a Title Property Only on Creation
If you want to set a title property only when a new data standard file is created, but not when one is edited, specify the create object in your code.
The object names are different, depending on whether you are creating a new Data Standard file with the vault-client or with AutoCAD or Inventor.
Set a Title Property for New Data Standard Files in AutoCAD or Inventor
function InitializeWindow
{
if ($Prop["_CreateMode"].Value -eq $true)
{
$Prop["Title"].Value = "my title"
}
}
Set a Title Property for New Data Standard Files in the Vault Client
function InitializeWindow
{
$dialogName = $dsWindow.DataContext.GetType().Name
if($dialogname--eq-"createfileviewmodel")
{
$Prop["Title"].Value = "my title"
}
}