Syntax
- string assetApproxSize(searchQuery, axisSize, n)
Parameters
- searchQuery—stringSearch query to apply on list of all files in the workspace. See fileSearch for details about the syntax.
- axisSize—string{ "x" | "y" | "z" | "xy" | "yz" | "xyz" }—Axes for the current scope.
- n—floatNumber (integer >= 1) of possible returned result strings (1 returned randomly out of n possibilities).
Returns
Asset with one of the best n size fits (according to axisSize).
Description
The assetApproxSize function returns one of the n best size fitting assets, from the files specified in searchQuery, according to the specified axisSize string.
Note:
assetApproxSize(searchQuery, axesSize, 1) = assetBestSize(searchQuery, axesSize)
Related
Examples
Inserting assets based on their (physical) size
The goal is to insert assets from a pool, depending on their (physical) size. The pool of assets is seen in the following image. Colors are (only) used to visually emphasize the size ratio. |
CGA examples with n = 1, n = 2 and n = 3:
Note:
- The geometry varies in the next three images by using only the n parameter.
- Small parts get blue assets while large parts get red assets.
n = 1:
| |
n = 2:
| |
n = 3:
|