BricsCAD provides a rich toolset to control 2D and 3D geometric model via parameters of different kinds, including:
- Global parameters, which includes parameters of 2D/3D dimensional constraints, user-defined parameters, and configuration parameters of design table,
- Local parameters, which includes parameters of arrays and constrained entities inside arrays, and parameters of inserts of parametric components.
All parameters and their current values are displayed under different sections in the Mechanical Browser. Parameter values can be linked together via expressions. When the value of a parameter is changed, the geometric model is updated automatically. This toolset allows BricsCAD users to add parametric behavior to any geometry and easily explore design variants.
|In BricsCAD there are no parent-child dependencies between geometric elements: for example, if you change a sketch used to create an extruded 3d solid, the solid is not changed accordingly. But you can always create any kind of dependencies using parameters and expressions.|
Global and local parameters
Parameters in BricsCAD can be global and local. Local parameters are attached to a particular entity: an associative array or a mechanical component. Global parameters are not attached to a particular entity; they are subdivided into four groups:
- parameters of 2D dimensional constraints,
- parameters of 3D dimensional constraints,
- user-defined parameters,
- configuration parameters of design tables.
To learn how to create 2D dimensional constraints, please read Using Dimensional Constraints.
To learn how to create 3D dimensional constraints, see 3D Constraints.
To create a user-defined parameter, follow the procedure described in Creating a New Parameter.
To create a configuration parameter for a design table, see Creating a design table to drive Parametric Blocks parameters.
Setting an expression to a parameter
You can set an expression to any parameter, being it global or local. The simplest expression is just a number of a name of a global parameter (local parameters cannot be referenced by names in expressions). A more complex expression can also include standard operators and functions (see below).
To set an expression to a parameter, click on the parameter name in the Mechanical Browser, and fill out the Expression field:
You can also set an expression to a parameter in command line using the -PARAMETERS command.
Driving and driven parameters
In expressions, you can use not only numbers, but also the names of global parameters. Such expressions are called non-constant. If a non-constant expression is set to a parameter, its icon, an open padlock () in the Mechanical Browser changes to the closed padlock ():
This means that the parameter becomes driven by other (driving) parameters: its value will be automatically recalculated when the values of the driving parameters will be changed.
You can create a chain of parameters, where every next element is driven by the previous ones. The length of such chain is not limited. Obviously you cannot create a loop, where the next element in a chain drives one of the previous elements, because it can result in infinite evaluation of expressions in the loop. BricsCAD automatically detects such expressions and therefore does not accept expressions, which lead to a parametric loop.
Parameters of Associative Arrays
Properties of associative arrays that can be controlled by an expression:
- Rectangular arrays: Number of columns, Column spacing, Number of rows, Row spacing, Row elevation increment, Number of levels, Level spacing, Axis angle.
- Polar arrays: Radius, Number of Items, Angle between items, Fill angle, Number of rows, Row spacing, Row elevation increment, Number of Levels, Level spacing.
To set an expression to any of these properties, select the corresponding array entity, either in the drawing area or directly in the Mechanical Browser and enter the expression in the corresponding properties field in the Mechanical Browser or in the Properties bar.
If an associative array contains entities constrained with 2D or 3D dimensional constraints, then parameters of these constraints can also be evaluated with expressions. These nested parameters are listed in the Mechanical Browser, and if you select any of them, you can set an expression to it:
Parameters of Mechanical Components
The BMUPDATEMODE system variable controls whether external assembly components are always reloaded or only in case they are modified.
If you insert a mechanical component or just a plain .dwg file into your drawing with BMINSERT command, and the insert contains global exposed parameters, then such parameters become local in the current drawing. They are associated with the corresponding component insert and are visible in the Mechanical Browser under the name of this insert. Click such parameter to edit:
A design table allows BricsCAD users to evaluate several global parameters at once using the value of one configuration parameter. Design tables can be created from scratch in BricsCAD or imported from a .csv file (a comma-separated values text file), which can be created with any spreadsheet software or a text editor.
Creating a Design Table from a .csv file
The expected format of the .csv file is:
Configuration_Name,Parameter1, Parameter2, ... , ParameterN
The first row lists the parameter names separated by a comma. The first name should not coincide with the name of any global parameter persistent in your drawing. It is called the configuration name. No spaces are allowed in the configuration name. Other names in the first row can (and usually do) coincide with the names of global parameters in your drawing. The next rows list possible values for these parameters, which can either be strings or numbers.
Importing such .csv file into BricsCAD using te DesignTable command results in creating a special global parameter by the name of the first name in the first row in the .csv file (= Size in the above example), which is called the configuration parameter. It will drive the values of other parameters in the design table, which are then called configuration-driven parameters.
BricsCAD does not keep the association with the .csv file, which was used to create a design table: if this file has been modified then the design table is not updated automatically. Use the -DESIGNTABLEEDIT command to replace a design table using a new or modified .csv file.
Direct Lookup in a Design Table
To evaluate a configuration parameter:
- Select it in the Mechanical Browser and type the desired value in its Expression field.
- Select a value in the drop-down list of the Value field:
Changing the value of a configuration parameter will result in automatic changing the values of all configuration-driven parameters of the corresponding design table. The values of these parameters are taken from the row in the design table, of which the first element coincides with the current value of the configuration parameter.
Reverse Lookup in a Design Table
Parameters, which are driven by a configuration parameter via a design table, can be evaluated independently. To do so, select the driven parameter and apply an expression to it. If the value of this expression matches one of the values for this parameter in the corresponding design table, then the configuration parameter and all driven parameters of the design table will be automatically set to the values specified in the corresponding row in the table. If several configurations are possible for a particular value of a driven parameter, BricsCAD selects the one, which is closest to the current values of other parameters.
If you enter an expression of which the result is not available in the design table, or if you enter expressions for two or more design table parameters, of which the values cannot be found in a single configuration (= the values are not found in the same row in the design table), then the values of the configuration parameter are changed to 'Custom', and the values of the other driven parameters are not changed. This case corresponds to a configuration, which does not exist in the design table.
Adding a New Configuration to a Design Table
You can add any 'Custom' configuration to a design table under a particular name. To do so, right click the configuration parameter in the Mechanical Browser and select Save current configuration in the context menu. The configuration will be added to the design tables 'Configuration_N', where 'Configuration' is the name of the configuration parameter, and 'N' is an index number, which is one more than the current number of configurations in the design table.
If you want to save a configuration in the design table under a different name, launch the -DesignTableEdit command.
Creating an Empty Design Table
Using the procedure described above (adding a new configuration to a design table), it is possible to start your design with an empty design table, and then fill it with the desired values.
To do so, use the 'Empty Design Table' tool, which asks you:
- The name of a new design table (which is also the name of the corresponding configuration parameter),
- The names of global parameters, which will be driven by this design table.
Using a Parametric Component with Design Tables
You can expose both configuration parameters and configuration-driven parameters to be used in assemblies. If you then insert such a component into your drawing, its parameters will include the exposed parameters of design tables, for which drop-down lists of admissible values will be available. Both direct and reverse lookup actions are supported for such parameters.
Other Actions with Design Tables
The -DESIGNTABLEEDIT command allows to:
- Delete a design table.
- Replace a design table.
- Link a new parameter to the design table or unlink an existing one.
- Add new configurations, remove an existing one, or export a design table into a .csv file.