7.8.11.2. Use mathematical function in sketch or feature algorithm?

It is often possible to create a sketch with or without using a feature algorithm [Attribute algorithm]. For example, you can perform a calculation directly in the sketch or assign it to a separate variable using a feature algorithm.

[Note]Note
  • You can use mathematical functions in the sketch. This functionality is saved in the 3db file. You can find an overview of all possible functions at Section 14.1, “PARTdesigner-Expressions ”.

    You can also use mathematical functions in the feature algorithm. This functionality is saved in the tab/tac file. You can find an overview of all possible functions at Section 7.8.12.6, “Mathematical functions (feature algorithm ) ”.

    The functional range of both options is similar, but not quite identical.

  • The result in the 3D model is identical.

  • Functions used in the sketch remain invisible to the outside.

  • Functions used in attribute algorithms can be controlled via table.

  • Mathematical function in sketch [87]

    If you only use variables without a feature algorithm, it is possible to create the sketch with the "Only in geometry [Only in geometry] " storage location [Save location] in the first step. You can tell from the color code that the variables H and L2 have been saved in the 3db file.

    The circle radius should be twice the height of the rectangle. The calculation is performed directly in the sketch.

    Radius: 2*H

    Mathematical function in sketch

    Mathematical function in sketch

    If necessary, you can save [Save location] later with "In geometry and table [In geometry and table] ". You can also use value range variables [Value range variables] and characteristic algorithms [Attribute algorithms] and create the table with the " In geomet [In geometry and table] ry and table" storage location [Save location].

    Variables saved with storage location [Save location] "In geometry and table [In geometry and table] "

    Variables saved with storage location [Save location] "In geometry and table [In geometry and table] "

    [Note]Note

    Conclusion: With the "Only in geometry [Only in geometry] " storage location [Save location], you can easily access the 3D object. This procedure is ideal for simple components or for demo purposes.

  • Mathematical function in attribute algorithm [88]

    The procedure is different if you use variables with a characteristic algorithm [Attribute algorithm]. The procedure using a characteristic algorithm will now be shown for the same component as above.

    You start by creating the variables with the storage location [Save location] In table only [Only in table] or In geometry and table.

    When creating the variables, select the option "Only in table [Only in table] " or "In geometry and table [In geometry and table] " under " Storage location [Save location] ". Fill in the fields and then click on "Apply [Commit] ".

    When creating the variables, select the option "Only in table [Only in table] " or "In geometry and table [In geometry and table] " under " Storage location [Save location] ". Fill in the fields and then click on "Apply [Commit] ".

    You can see from the color code where the variables L2, H and R are saved. To create the table, it is sufficient to save with the "Only in table [Only in table] " storage location [Save location]. (color code ). The data is stored in the tab/tac file.

    However, if variables are also to be used in the 3D model, they must be saved in both the 3db file and the tab/tac file. You can ensure that they are saved in the 3db AND tab/tac file by selecting a variable, selecting the "In geometry and table [In geometry and table] " storage location [Save location] and clicking Apply [Commit].

    You can tell by the color code that the variables have been saved [Save location] with the storage location [Save location] "In geometry and table [In geometry and table] ".

    For the mathematical operation R = 2*H (circle radius is 2x rectangle height), the variable R is created with the status [Status] "Feature algorithm [Attribute algorithm] ".

    The algorithm is entered under Formula [Equation] and the Characteristic algorithm [Attribute algorithm] option under Status.

    The variable R can now be used in the sketch for the parameter input of the circle radius.

    Variable "R" with feature algorithm [Attribute algorithm]

    Variable "R" with feature algorithm [Attribute algorithm]

    Optionally, the variable [Variable] R can be displayed with the stored feature algorithm [Attribute algorithm] in the PARTdataManager can be displayed.

    1. Click in PARTproject under Edit project -> General tab -> Variables section -> Order/groups of variables [Order/Groups of Variables] on the button ....

      -> The same named dialog box opens.

    2. Select the group of secondary variables [Secondary variables] on the left and move the variable R to the middle field. You can find details on this at Section 5.9.2.3.3, “ Variable groups - Hide columns (variables) ”.

    3. Finally, confirm with OK.

    4. Open PARTdataManager.

      The variable R is displayed in the table.

      [Note]Note

      Conclusion: To use feature algorithms [Attribute algorithms], work with the "In table only [Only in table] " or "In geometry and table [In geometry and table] " storage location [Save location]. However, you then have the option of controlling via the table.

      With regard to the 3D model, the mathematical calculation could have been carried out in the sketch only (see above).




[87] You can find a suitable example of this in the training catalog in the directory \v11_news\expression_in_sketch_or_algorithm\expression_in_sketch.prj.

[88] You can find a suitable example of this in the training catalog in the directory \v11_news\expression_in_sketch_or_algorithm\expression_in_algorithm.prj.