BricsCAD provides a rich toolset to control 2D and 3D geometric models with parameters of different kinds. This includes:
- Global parameters; parameters of 2D/3D dimensional constraints, user-defined parameters, configuration parameters of design table, etc.
- Local parameters; parameters of arrays and constrained entities inside arrays, parameters of inserts of parametric components, etc.
All parameters and their current values are can be found in different sections in the Mechanical Browser. Parameter values can be linked together via expressions. When you change the value of a parameter, the model is updated automatically. This workflow allows you to add parametric behavior to any geometry and explore design variants easily.
|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. However, you can create dependencies with parameters and expressions afterward.|
Global and local parameters
Parameters in BricsCAD can be global or 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, see Using Dimensional Constraints.
To learn how to create 3D dimensional constraints, see 3D Constraints.
To create a user-defined parameter, see Creating a New Parameter.
To create a configuration parameter for a design table, see Creating a design table to drive Parametric Blocks parameters.
Define an expression for a parameter
You define an expression for any parameter type, global or local. The simplest expression is a number or the name of a global parameter (local parameters cannot be referenced in expressions). A more complex expression can include standard operators and functions (see below).
To define an expression for a parameter: in the Mechanical Browser, click on the parameter name and fill out the Expression field:
You can also define an expression for a parameter in the command line using the -PARAMETERS command.
Defining dependent parameters
In expressions, you can use both: names of global parameters and numbers. This is known as a 'non-constant expression'. If a non-constant expression is set to a parameter, its icon changes from an open padlock () to a closed padlock (), in the Mechanical Browser:
This means that the parameter becomes dependent on other (defining) parameters (its value will be automatically recalculated when the value(s) of the defining parameter(s) changes).
You can create a chain of parameters, where every element is dependent on the previous one. There is no limit to the length of the chain. However, be careful not to create a loop where the next element in a chain drives one of the previous elements. This might result in an infinite evaluation of expressions. BricsCAD automatically detects such problems and does not accept expressions that lead to a parametric loop.
Parameters of Associative Arrays
Properties of associative arrays that can be controlled with an expression:
- Rectangular arrays :Number of columns, Column spacing, Number of rows, Row spacing, Row elevation increment, Number of levels, Level spacing, and Axis angle.
- Polar arrays: Radius, Number of Items, Angle between items, Fill angle, Number of rows, Row spacing, Row elevation increment, Number of Levels, and Level spacing.
To define an expression for any of these properties, select the corresponding array entity, either in the drawing area or 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. If you select any of them, you can define an expression:
Parameters of Mechanical Components
The BMUPDATEMODE system variable controls whether external assembly components are always reloaded or only when modified.
If you insert a mechanical component or just a plain .dwg file into a drawing with BMINSERT command and the insert contains global exposed parameters, these parameters are converted to local parameters. They are associated with the corresponding component insert and are visible in the Mechanical Browser under the name of this insert. Click the parameter(s) to edit:
A design table allows you to evaluate several global parameters at once with the value of one configuration parameter. You can create design tables from scratch in BricsCAD or import them from a .csv file (a comma-separated values text file). You can create such files with a spreadsheet software package 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 must be different from the name of any global parameter in your drawing. It is called the configuration name. No spaces are allowed in the configuration name. Other names in the first row can be identical to the names of a global parameter The next rows list possible values for these parameters as strings or numbers.
Use the DesignTable command to import a .csv file into BricsCAD. This creates a special global parameter by the name of the first name in the first row of the .csv file ('Size' in the above example). This is called the 'configuration parameter'. It will drive the values of other parameters in the design table. These are called 'configuration-dependent parameters'.
BricsCAD does not maintain an association with the .csv file, used to create a design table: if this file is modified then the design table is not updated automatically. Use the -DESIGNTABLEEDIT command to replace a design table with 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:
If you change the value of a configuration parameter all configuration-dependent parameters' values change automatically on the corresponding design table. The values of these parameters are taken from the row in the design table. The first element coincides with the current value of the configuration parameter.
Reverse Lookup in a Design Table
You can evaluate parameters, that are defined by a configuration parameter with a design table independently.
Select the dependent parameter and apply an expression to it.
- If the value of this expression matches one of the values in the corresponding design table, then the configuration parameter and all dependent parameters of the design table will automatically change to the values specified in the corresponding row in the table.
- If several configurations are possible for a particular value of a dependent parameter, BricsCAD selects the one closest to the current values of the other parameters.
- If you enter an expression and the result is not available in the design table or if you enter expressions for two or more design table parameters and 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 dependent parameters are not changed. This case corresponds to a configuration that does not exist in the design table.
Add a New Configuration to a Design Table
You can add any 'Custom' configuration to a design table and assign it a 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 as Configuration_N'
- Configuration: the name of the configuration parameter
- N: an index number - 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
If you use the procedure described above, it is possible to start your design with an empty design table and then fill it with the desired values.
Use the 'Empty Design Table' tool. You will be asked:
- The name of a new design table
- The name of the corresponding configuration parameter,
- The names of global parameters that will be dependent on this design table.
Using a Parametric Component with Design Tables
You can use both configuration parameters and configuration-dependent parameters in assemblies. If you then insert such a component into your drawing, its parameters will include the exposed parameters of design tables. A drop-down list of available values will be available. Both direct and reverse lookup actions are supported for such parameters.
Other Actions with Design Tables
The -DESIGNTABLEEDIT command allows you to:
- Delete a design table.
- Replace a design table.
- Link a new parameter.
- Unlink an existing parameter.
- Add new configurations, remove an existing one
- Export a design table as a .csv file.