Configure creation dialogs and tabs to display custom object data.
Requirements
Three components are required for custom object support:
By default, all three components are provided with Data Standard. These components are pre-configured to work with a custom object in Vault called Task.
The new custom object Task is fully initialized and ready to use.
To define your own custom object, copy the three components from the Task sample and modify as needed.
Following are examples of a custom object called Person.
Menu Entries
The context menu entries to create and edit a dialog are defined here:
%programdata%\Autodesk\<Vault version>\Extensions\DataStandard\Vault\MenuDefinitions.xml
The menu entry definitions must be created:
<NewTask Label="CreatePerson..." Description="New Person" Hint="Create a new person object" PSFile="CreateCustomObject.ps1" Image="NewCustomObject.ico" ToolbarPaintStyle="TextAndGlyph" NavigationTypes="Person" MultiSelectEnabled="false"/> <EditTaskLabel="Edit Person..." Description="Edit Person" Hint="Edit a person object" PSFile="EditCustomObject.ps1" Image="EditCustomObject.ico" ToolbarPaintStyle="TextandGlyph" NavigationTypes="Task" MultiSelectEnabled="False"/>
Next, create a menu site for the new custom object.
<TaskLabel="Person" DeployAsPullDown="False" Location="Person"> <ItemName="NewPerson"> </Item> <ItemName="EditPerson"> </Item>
See Customize the Data Standard MenuDefiniftions.xml File for more details about the menu syntax.
Scripting Files
The menu definitions in the MenuDefinitions.xml file point to PowerShell files. These files are located at %programdata%\Autodesk\<Vault version>\Extensions\DataStandard\Vault\addinVault\Menus.
The default CreateCustomObject.ps1 and EditCustomObject.ps1 PowerShell file work for every custom object. There is no need to create additional PowerShell files. However, it is still possible to customize and create PowerShell files for the new custom object by performing these tasks:
Modify the XAML filename that defines the Data Standard dialog by replacing Task with Person.
... $xamlFile = New-Object CreateObject.WPF.XamlFile "PersonXaml", "%ProgramData%\Autodesk\Vault 2016\Extensions\DataStandard\Vault\Configuration\Person.xaml" $dialog.XamlFile = $xamlFile ...
Dialogs and Tab
The XAML file for the custom object create and edit dialog is specified in the PowerShell files (see above). By default, the XAML files for the create and edit dialogs as well as the tabs are located here:
%programdata%\Autodesk\<Vault version>\Extensions\DataStandard\Vault\Configuration
The default CustomObject.xaml works without any changes. However, you must use the CustomObject.xaml file as a template to create a XAML file for the new custom object.
Get a Datasheet tab for the new custom object