Data Standard 樣板

Data Standard 使用文件樣板,以建立新的 Data Standard 檔案。

依預設,「新標準檔案」功能會在 Vault 的 $\Templates 資料夾中尋找文件樣板。可以在 Data Standard File.xml 中修改此路徑。

管理員也可以選擇為不同的應用程式指定不同的樣板資料夾 (例如,一個用於 AutoCAD 樣板,另一個用於 Inventor 樣板)。

運作方式

Data Standard 的預設「新檔案」對話方塊包含一個「文件類型」組合方塊。

在使用者從「文件類型」清單中選取一個選項並按一下「確定」後,Data Standard 的「新檔案」功能會在與該文件類型關聯的 Vault 資料夾路徑中尋找樣板。該樣板用於產生新檔案。

%programdata%\Autodesk\<Vault 版本>\Extensions\DataStandard\Vault\Configuration\File.xml

<?xml version="1.0" encoding="utf-8"?>
                <DocTypeData xmlns="">
                    <DocTypeInfo>
                        <DocName>Inventor</DocName>
                        <Path>$/Templates/Inventor</Path>
                    </DocTypeInfo>
                    <DocTypeInfo>
                        <DocName>AutoCAD Drawings</DocName>
                        <Path>$/Templates/AutoCAD</Path>
                    </DocTypeInfo>
                    <DocTypeInfo>
                        <DocName>Office Document</DocName>
                        <Path>$/Templates/Office</Path>
                    </DocTypeInfo>
                </DocTypeData>
           

<Name> 元素定義「新檔案」對話方塊的組合方塊中顯示的值。<TemplatePath> 元素對使用者不可見,而是用於設定視圖模型內的 "TemplatePath"。

「文件類型」組合方塊如下所示:

...
<Label Content="Document Type" Grid.Row="2" Grid.Column="0" />
<ComboBox ItemsSource="{Binding Source={StaticResource DocTypes}, XPath=DocTypeInfo}"
          Name="DocTypeCombo"
          Grid.Row="2"
          Grid.Column="1"
          IsEnabled="{Binding IsNewEntryDialog}"
          DisplayMemberPath="Name"
          SelectedValuePath="TemplatePath"
          SelectedValue="{Binding TemplatePath}"
          SelectedIndex="0"></ComboBox>
...

DisplayMemberPath 屬性定義將資料來源中的哪個元素顯示在組合方塊中。在此例證中,設定為「Name」。

SelectedValuePath 屬性定義將資料來源中的哪個元素 ("TemplatePath") 設定為要使用的樣板路徑值。

SelectedValue="{Binding TemplatePath}" 屬性設定視圖模型下的所選樣板路徑。需要將新的繫結性質 "TemplatePath" 加入至視圖模型。

Vault Office Data Standard 樣板

Vault Office Client 提供許多與 Vault 用戶端功能相同的功能,但經過精簡化,以專注於非 CAD 設計資料管理程序。由於 Vault 用戶端和 Vault Office Client 各有其自己的 XAML,因此可以為每種用戶端建立特有的「Data Standard」對話方塊。

修改 FileOffice.XAML,來自訂 Vault Office Client 的「Data Standard」對話方塊。

已為 Vault Office Client 定義一個樣板,名為 FileOffice.xml

    FileOffice.xml 位於 %programdata%\Autodesk\<Vault 版本>\Extensions\DataStandard\Vault\Configuration

<?xml version="1.0" encoding="utf-8"?>
                <DocTypeData xmlns="">       
                    <DocTypeInfo>
                        <DocName>Office Document</DocName>
                        <Path>$/Templates/Office</Path>
                    </DocTypeInfo>
                </DocTypeData>