這個主題說明如何使用 Variable Studio 的功能與機制來建立可用在自身文件與其他文件中變數。您僅能透過 Onshape 的瀏覽器平台來建立 Variable Studio,不過,您可以在所有行動裝置平台上檢視與使用變數。

Variable Studio 是在文件中建立的,可以立即在該文件工作區的所有 Part Studio 與組合件內使用其中的變數。

建立 Variable Studio

  1. 在文件中使用 Plus sign menu 來建立一個 Variable Studio:

  2. 系統會開啟 Variable Studio 附有變數的表格以供輸入:

  3. Type the name of the first variable in the Name column. (Only alphanumeric characters are allowed.)

  4. Press Tab to move to the next row. A default type of Length is entered for the variable; to change it, use the drop down arrow and select a new type.

  5. 輸入變數的預設值以及選擇性描述。

To reorder the inputs in the table, right-click and select Move up or Move down. You can also drag the inputs to reorder them.

Use the caret to the left of the Variable Studio title to collapse or expand the section. To collapse (or expand) all tables at once, click the three-dot menu on the right side of the title block and select Collapse (or Expand) all tables.

您可以使用之前在表格中定義的變數來在之後於表格中定義另一個變數。例如:

L1 變數 (length of the table top 桌面長度) 是用來計算 W1 變數 (width of the table top 桌面寬度)。

若要能夠在工作區內的所有 Part Studio 與組合件中使用變數,請核取 Variable Studio 分頁底部邊緣的方塊:

取消核取這個方塊將會無法在此文件工作區的 Part Studio 與組合件中使用變數 (如果變數仍是在草稿狀態,可繼續不核取這個方塊,當變數就緒可用時,再核取這個方塊)。

在其他文件中參考變數表格

若要在非定義變數表格的文件中使用變數表格 (以及其中定義的變數):

  1. 開啟您要使用於另一文件的 Variable Studio 中定義變數的文件。

  2. 使用 Plus sign menu 按鈕來建立一個 Variable Studio。

  3. 在新的 Variable Studio 中按一下上方的按鈕:插入 Variable Studio。「插入 Variable Studio」對話方塊開啟:

  4. 選擇對話方塊頂端的兩個分頁之一,以決定要在何處找出變數表格:「目前文件」或「其他文件」。

    如果在目前文件中有任何的 Variable Studio,其會列在「目前文件」的下方。若要在另一文件中找出 Variable Studio,則請選擇「其他文件」的分頁:

    您可以選擇一整個 Variable Studio 表格 (如上方所示的 Variable Studio 1),或是從清單中選擇一或多個不同的變數。您做出的選取項目可立即用於目前的文件中。在插入來自另一文件的變數表格或變數的情況下,文件必須要有一個包含變數的版本。如果沒有版本存在,系統會提示您要建立一個版本才能繼續。

    在成功選擇變數和/或變數表格之後,您會在目前文件的 Variable Studio 中看到選取的項目:

插入表格來源處的 Variable Studio 名稱和版本會顯示在表格的最上方,如上圖所示的 Variable Studio 1 V1。

發行 Variable Studio

在 Variable Studio 分頁上按右鍵,然後選擇 [發行]:

發行 Variable Studio

詳細資訊請參考發行管理典型的發行工作流程

For an additional Learning center resource, register for the following course: Variables and Expressions (Onshape account required).