PowerShell Functions for Data Standard
PowerShell functions are used to programmatically customize business logic, behavior, default values, and the user interface.
Data Standard comes with several functions that are required to work with the standard dialogs and tabs. Some functions are called from inside the Data Standard Add-Ins.
These functions are mandatory and should not be removed.
The functions can be regarded as event driven functions and can be modified to change the behavior. Other functions are called directly from the XAML file. For example, to retrieve information from the Vault database (e.g.,-available-numbering-schemes,-categories).
All *.ps1 and *.psm1(powershell-module) files that are located in the "addinVault" (Vault) or "addins" (CAD) folders are automatically imported and used.
The following chart contains a list of the functions that are directly called either from an Add-In or from a XAML file. For better readability of the code, these functions may call other functions. These other functions, are not explicitly listed.
Function | File | Usage Add-in | Usage XAML | Description |
---|---|---|---|---|
ActivateOKButton | Vault: Default.ps1 | Vault | Used for validation and enabling the OK button in edit and create dialogs. By default it calls the function Validate() which then, based on the window type, calls further validation functions. Because ActivateOkButton is called every time data is changed on the dialog, this can cause performance problems if the validation functions are too complex. | |
AddinLoaded | CAD: Default.ps1 | CAD | Called when the VDS Inventor- or AutoCAD-Addin is loaded. | |
Addinunloaded | CAD: Default.ps1 | CAD | Called when the VDS Inventor- or AutoCAD-Addin is unloaded. | |
GetCategories | Vault, CAD: Default.ps1 | Vault, CAD | This function is used in the create dialogs for Vault and CAD to show categories in a combo box. The default implementation returns a list of all file, folder, or custom entity categories based on the window name. Used for Dynamic Properties. For CAD edit dialogs, the assigned category is returned. | |
GetNewCustomObjectName | Vault: Default.ps1 | Vault | Called when clicking the OK button in a create custom object dialog. This function returns the name of the new custom object. The default implementation either gets the value from a create dialog control with the name CUSTOMOBJECTNAME or from a special property _GeneratedNumber if Vault numbering schemes are defined. See Data Standard and Numbering Schemes for more information. | |
GetNewFileName | Vault: Default.ps1 | Vault | Called when clicking the OK button in a create file dialog. This function returns the filename of the new file. The default implementation either gets the value from a create dialog control with the name FILENAME or from a special property _GeneratedNumber if Vault numbering schemes are defined. See Data Standard and Numbering Schemes for more information. | |
GetNewFolderName | Vault: Default.ps1 | Vault | Called when clicking the OK button in a create folder dialog. This function returns the name of the new folder. The default implementation either gets the value from a create dialog control with the name FOLDERNAME or from a special property _GeneratedNumber if Vault numbering schemes are defined. See Data Standard and Numbering Schemes for more information. | |
GetNumSchms | Vault, CAD: Default.ps1 | Vault, CAD | This function is used in file create dialogs for Vault and CAD to show numbering schemes in a combo box. The default implementation returns all activated Vault file numbering schemes. The default numbering scheme is a scheme with the same name as the selected category. If a scheme does not exist with the same name as the selected category, the scheme is the default scheme set in the Vault settings. | |
GetParentFolderName | Vault: Default.ps1 | Vault | Called when clicking the OK button in a create folder dialog. This function can be used to force a specific folder name when using New Standard File or New Standard Folder functions. If an empty string is returned the selected folder is used. | |
Vault: Default.ps1 | Vault | Called when initializing Data Standard tabs in Vault. | ||
Vault: Default.ps1 | Vault | Called when initializing Data Standard dialogs. | ||
ItemTitle | Vault: Default.ps1 | Vault | Used in tabs for Item and ECO objects. The default implementation returns the value of the item or ECO "Title (item,CO)" property. | |
ItemDescription | Vault: Default.ps1 | Vault | Used in tabs for Item and ECO objects. The default implementation returns the value of the item or ECO "Description (item,CO)" property. | |
OnLogOn | Vault: Default.ps1 | Vault | Called when a user logs into a vault. | |
OnLogOff | Vault: Default.ps1 | Vault | Called when the user logs off. | |
CAD: Default.ps1 | CAD | Called when the Data Standard dialogs is closed by clicking the OK button, and before the filename is set the properties are updated. | ||
Vault: Default.ps1 | Vault | Called when the context of a custom tab in Vault changes. Is used to update the data that is shown in the tab. | ||
SetWindowTitle($newFile, $editFile, $name) | Vault, CAD: Default.ps1 | Vault, CAD | Called from InitializeWindow function. This function is fed with inputs depending on CreateMode or EditMode as well as whether it is for File, Folder or CustomObject. The output that is returned is set as the title of the Dialog. |