Hide Table of Contents

Adding Constraints to CustomBlocks

Within a CustomBlock, you can apply constraints to maintain geometric relationships and size as you modify the CustomBlock.

  • Geometric constraints define the relationship between entities of the CustomBlock definition. For example, you can specify that two circles should always remain concentric or that a side of a polygon should always be horizontal.
  • Dimensional constraints let you control the size of entities of the CustomBlock. For example, you can define dimensional constraints to maintain the length of a polygon segment.

Dimensional Constraints Parameters

Dimensional constraints from the Block Editor are called constraint parameters.

Constraint parameters let you expose custom grip points and custom properties of the CustomBlock. Using constraint parameters you can control the distance, length, diameter, radius, and angle values of entities within a CustomBlock. Changing the value of constraint parameters changes the size of the related entities.

Additionally, you can define mathematical expressions to specify relationships between constraint parameters. For example, you can specify that the diameter of a circle is always half of the length of another entity.

You can use both, dimensional constraints and constraint parameters in CustomBlock definitions. Also, you can convert existing dimensional constraints into constraints parameters.

In the Block Editor, the tools for adding constraint parameters are grouped on the Dimensional panel of the Edit Block ribbon tab.

Use the CBCElement command to add a dimensional constraint parameter to an entity of a CustomBlock definition. Command options correspond to the choices provided by individual element commands from the Block Editor (Dimensional panel).

Example:

d1 is a dimensional constraint parameter

d2 is a dimensional constraint

User Parameters in CustomBlocks

User parameters let you define editable custom properties for a Block reference. Blocks update automatically if any user parameter is changed.

In the Block Editor, the Parameters palette lists:

  • Action parameters
  • Dimensional constraint parameters
  • User parameters
  • Attributes

To convert a dimensional constraints into a dimensional constraint parameter:

  1. In the Block Editor, select a dimensional constraint.
  2. On the ribbon, click Edit Block > Dimensional > Convert.

    In the Parameters palette, the specified dimensional constraint is moved under Dimensional Parameters.

Parent Topic

Adding Constraints



Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   About Constraints within CustomBlocks
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: 2025 SP2

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.