예 – 다른 Data Standard 대화상자 로드

파일, 폴더 및 사용자 객체 도면요소에 대한 XAML 파일은 미리 구성되어 있습니다. 그러나 이 디렉토리에 XAML 파일을 더 작성할 수 있으며, 동일한 도면요소에 대해 다른 XAML 파일을 표시할 수 있습니다.

동일한 도면요소에 대해 서로 다른 대화상자를 표시하려면 이 디렉토리(%programdata%\Autodesk\Vault [버전]\Extensions\DataStandard\Vault\addinVault\Menus)에 해당 내용이 포함된 PowerShell 파일을 작성합니다.

사용자 XAML 파일의 예

$vaultContext.ForceRefresh = $true
$currentSelected = $vaultContext.CurrentSelectionSet[0]
$folderid = $currentSelected.Id
#if selected object is of type 'FILE' then use $vaultContext.NavSelectionSet[0].Id,
#it will give you back the folder Id where this file is located
if ($currentselected.typeid.entityclassid--eq-"file")
{
    $folderid = $vaultContext.NavSelectionSet[0].Id
}
 
$xamlFile = New-Object CreateObject.WPF.XamlFile "MyOwnXaml", "C:\ProgramData\Autodesk\Vault [edition]\Extensions\DataStandard\Vault\Configuration\myfile.xaml"
$dialog = $dsCommands.GetCreateDialog($folderid)
$dialog.XamlFile = $xamlFile
 
#new file can be found in $dialog.CurrentFile
$result = $dialog.Execute()
$dsDiag.Trace($result)
 
if ($result)
{
    $folder = $vault.DocumentService.GetFolderById($folderid)
    $path=$folder.FullName+"/"+$dialog.CurrentFile.Name
 
    $selectionId = [Autodesk.Connectivity.Explorer.Extensibility.SelectionTypeId]::File
    $location = New-Object Autodesk.Connectivity.Explorer.Extensibility.LocationContext $selectionId, $path
     
    #$dsDiag.Inspect()
    $vaultContext.GoToLocation = $location
}

대화상자가 로드되면($dialog.Execute() 사용) Data Standard 함수를 사용하여 관리할 수 있습니다. 위 샘플에서 코드를 실행하는 방법에 대한 자세한 내용은 메뉴 항목을 참고하십시오.