I recently got a question through email from a 2D Drafting user about the drawing getting slow. This is what he said.
I'm having annother issue, now different from the former. My file now has 1.996 KB and it is very slow to edit. It needs sometimes minutes to edit a contstraint. The whole draft was made in only one piece, since it is the only way to make it, and the slowness happens only when inputting a constraint on the full drawing, since when I draw something separated from the main drawing it is normally fast. I wonder if you could help me with that.
I will respond to this post with the answer that I gave to him.
This is a long reply so make sure you read it all. It gives some details of what happens when applying constraints.
Let me explain how constraint systems works. Think of constrains overall as a system that needs to be solved at one time. When a modification is made to a single entity in the system the overall constraint system has to be computed or resolved collectively.
A simple example is a rectangle that has Horizontal/Vertical lines. It looks simple doesn’t it. The system of constraints is more complex than you think. Within this rectangle system there are the following that are all computed together to maintain the integrity of the overall constraint system.
4 endpoint constraints
4 Horizontal/Vertical (H/V) constraints
2 dimensions (length and width)
When the length dimension is modified, all of this information must be considered for the overall system and is included in the solve process. You cannot simply change the length of the single line that the dimension is connected. Changing this dimension changes the length of the line that is endpoint connected to the vertical lines; that are end point connected to the line on the other side. The orientation of the lines cannot change because of the H/V constraints, and so on.
When you draw another rectangle that is in no way constrained to the first, then there are two totally unrelated constraint systems. Modifying one rectangle has no effect on the other so both are not put into the solver, only the one that is being modified is computed. But, maybe you add a horizontal constraint between the top two lines of the two rectangles. The overall constraint system of either rectangle is NOT increased by the new constraint. What happens is that everything from both rectangles and the new horizontal constraint is now one overall constraint system. This means that everything is solving at one time. The larger the overall system gets, the longer it takes to solve a single modification.
What does all of this mean for large, more complex drawings? You need to learn how to build your drawing in a way that limits the overall constraint system which will improve solve time. There are a number of ways to do this.
Often there are smaller parts of the overall drawing that can be locked down within a subset of the overall. You know that this subset does not change within itself, it only moves within the larger drawing. You can do this by creating blocks. Blocks are a set of geometry that is constrained within itself. When included in a larger drawing, the drawing sees the block as a single entity for constraining. This greatly reduces overall solve because all the constraints in the block are not considered. The block moves as a single component.
Another way to do this is create a ‘Rigid Set’ or rigid sets. ‘Rigid Set’ is in the Relate command group. A Rigid Set has the same benefit as a block with respect to solving. It allows you to take a set of geometry and constraints on your drawing and lock them down into a rigid component within itself. The constraints within this component are not considered outside of the component. The component, like the block, moves as a single component. If you need to modify the geometry in the rigid set, delete the Rigid Set constraint and this frees up the geometry for modification. Then recreate the Rigid Set
Now go back to the rectangles example. A rectangle is created and used to create a block. Then the second rectangle is used to create another block. There are two blocks on the drawing. Then the horizontal constraint is placed between the two top lines of the two blocks(rectangles). The constraint system looks like the following:
Notice that the endpoint constraints, H/V constraints, dimensions, and geometry within each block are not solved. They are locked within the blocks.
You can do the same with two Rigid Sets. The nice thing about blocks is that you can place multiple occurrences of the same block. If you need to make a change to all of the occurrences, you only have to change one and all will update.
I know that this is a lot of information. You may need to read through it a few times to understand the concepts. But, if you use some of the tools defined here you will have better success with more complex drawings.