SOLIDWORKS, Simulation, Engineering Services

SOLIDWORKS in Motion: Creating and Positioning Blocks

By Keith Pederson on April 21, 2021

Every SOLIDWORKS user has the power to leverage motions synthesis and simulations tools. In this article, we’re going to prove it by covering functions that are available in every license level of SOLIDWORKS, as well as every version, going all the way back to 2007.

We are going to start by taking a closer look at part sketches, which is the easiest and fastest way to synthesize a desired motion in SOLIDWORKS. You can do planar, 2D mechanism design in a single SOLIDWORKS part file, and within a single sketch. We can then use blocks in the sketch to group lines. Lines grouped into a block gain positional independence, and so then serve as the parts and sub-assemblies of your machine. All of these layers of power build upon a strong understanding of how the SOLIDWORKS dynamic constraint solver works in a sketch.

Understanding Shape - Size - Position

A lot of CAD users migrated to the screen from the drafting board. On paper, whether designing a single part or a complex assembly, you always started by laying out your construction lines to establish critical datums, actuation paths, and even your tolerance zones (very lightly scribed with 4H pencil). Only after you have the whole bird’s nest of layout lines in a believable state, would you get out a 2H pencil and start darkening in those lines that were the real parts.

The underlying limitation of paper was that lines were easy to draw, but hard to erase. So you’d better get the layout lines in the final position, then darken in the lines to establish the shape, and finally get out your trusty electric eraser to carefully trim lines to the right size.

The gist of this method was: Position – Shape – Size.

Then along came parametric CAD with dynamic constraint solvers. We were taught to re-order that whole process. You first rough-sketch in the final shape, then dimension to the right size, and finally constraint/dimension to the right position. Why? Because electronic ink never dries. There is now no cost to getting lines ‘wrong’ at first, and then correcting them later as your design starts to come together.

The new mantra of sketch creation is now: Shape – Size – Position.

Don’t get me wrong, I’m not yearning for the ol’ days. The new workflow is better, faster, and has a lot more flexibility. It was a game changer that meant every designer and engineer could now effectively do their own ‘drafting’. We’ve practically eliminated the job descriptions Layout Draughtsman, Draughtsman, and Detailer from the job market.
However, layouts are not dead! When you are designing a multi-part, multi-articulated machine, you still want to start with a master layout.

But there is a right way to do SOLIDWORKS layout sketches, and it is not always fully understood or used correctly in the field. So before we go any further, I first have to show you how to create the machine skeleton as a master layout using blocks.

Blocks Are Your Friends

SOLIDWORKS software uses pretty much the same constraint solver for 2-D sketches as it does for 3-D assemblies. This means that you can do motion design and synthesis in a sketch with dynamic dragging the same as in an assembly. You can put a lot of top-level thinking all in one file, minimizing your document control overhead.

Putting a lot of top-level thinking in one file does come at a price. Each time you lay in a line or a circle, the sketch solver dynamically ‘solves’ its effect upon all other lines already in the sketch. For the first 100 or so lines, this cost is negligible. After about 300 to 500 lines, you will notice that each new line is balky, appearing, and then updating about a half-second behind your mouse-clicks. Over about 800 sketch entities, this performance becomes unsustainable. The rebuild cost goes up roughly as the square of the total number of relations, so you are guaranteed to hit a tipping point. This is where the long-time AutoCAD users often just give up and go back to their old horse.

So, the first thing you need to know is that this automatic relationship solving can be suppressed. You can see this option by going to Tools > Options > System Options and click on the SKETCH category. The option “Turn Off Automatic Solve Mode” is available with a numerical threshold. This will effectively dumb-down SOLIDWORKS to the same level as AutoCAD. The performance cost for each new line is very small and will only grow linearly. (I don’t recommend you turn this option off. I just wanted you to know that it is available.)

SOLIDWORKS Sketch Automatic Solve ModeThis function is similar for assemblies, too. When I let an assembly get bigger than about 800 to 1,200 parts, the rebuild time will eventually become non-productive. And yet, we see customer examples of assemblies with 10,000 or 30,000 parts and they seem to perform OK. How is that possible?

The trick in an assembly is to make effective use of sub-assemblies. I would never put 1,000 parts on a flat, single-level bill of materials. I would indent that list by using Sub-Assemblies. By default, SOLIDWORKS treats all the parts and all the mates inside a sub-assembly as a single rigid body. The internal mates do NOT solve dynamically. They WILL update when you force a rebuild but are not actively updating all the time. Mystery solved.

Back to our 2D sketches, when we group lines together into a sketch block they drag all their local relations into that block as well, thus removing them from the top-level solver.

A Sub-Assembly is to the top-level Assembly,
- as -
A Block is to the Sketch

Just as an assembly can have multiple levels of indented sub-sub-assemblies, a block can have indented levels of sub-blocks. This can be very useful, up to a point. I seldom use more than 2 levels of blocks myself.

So in summary, a block in SOLIDWORKS behaves a lot like a block in AutoCAD and is an ideal way to group lines in a complex layout to sort by function. Blocks can also isolate their internal sketch relations, eliminating performance issues. And most importantly, the combination of having the dynamic constraint solver and the rigid blocks gives us a new opportunity to plan out and animate our machine motion - all in one sketch!

Creating and Positioning Blocks

When you add several instances of a part file to an assembly, it is understood that each instance will be of the same shape and size, but they will all occupy different positions. Blocks in a sketch behave the same way. When you group a bunch of lines together to first create a block, all the shape and size relations get dragged into the block also.

But the position relations, relative to the sketch origin, disappear. The block becomes free-floating. That’s not a bug; SOLIDWORKS does that on purpose. The block can thus be built in any position and then, multiple instances of the block can appear and be located anywhere else in the sketch. The block is never ‘locked in’ to any top-down relationships as to where the first instance of that block was created. The role that the sketch origin once had in the block’s life, is replaced by a new, local origin, that you are free to place anywhere convenient. When you deploy new copies of the block, that new local origin will be the drag/snapping handle.

That’s enough theory, let’s get down to the mouse-clicks. Watch the short video below for a high-level overview of how the simplest of blocks are created, then positioned. It’s pretty much just to orient you in the process and to inspire you to dig deeper into these commands. We’ll get into more detailed teaching videos soon.

For large machinery design, I will always create the first block as the overall skeleton in which I establish the most critical dimensions, lines-of-action, throw limits, etc. This block is usually static. Then I create all the other blocks on the top-level of the sketch, as the parts. They might be static, located by hanging them on points or lines of the layout block, or they might be left partially constrained so they can animate.

If the design is very large, I will sometimes make sub-blocks inside the layout block. For example, if an injection molding machine has a fixed mold-base side and a sliding toggle-ram for the injection head assembly, I might put all the head layout into a sub-block. Then, with just one dimension change, I can ‘slide’ the head to any position along its track and examine the machine in any actuation position. But the hydraulic cylinder, toggle-ram sheaves, and the parts of the head sub-assembly would all be individual blocks at the top level, NOT anywhere in the layout. They must be independent in order to freely animate.

If you have never created blocks before in SOLIDWORKS, you want some additional instructional with more of the details, I recommend the two videos below by O'  for this stage of our discussion. 

Once you’ve gotten the hang of basic block creation and positioning/animation, this next video shows how you can conduct range-of-motion studies. You use some dimensions that are inside a block to re-size components, and other dimensions that are global to the sketch, to survey measurements or control animation position.

>> Learn More About TriMech's SOLIDWORKS Motion Training

Levels of Structure and Managing Changes

At this point, let’s assume that we are all comfortable with block creation and positioning. But things change and you may have to edit those blocks. The first consideration before making any change is the impact that change should have. Local to this one block? Or global across all the instances of that block?

One thing we’ve learned today is that SOLIDWORKS sketches do not have to be flat, single-level lists of lines. With blocks, you create indented sub-structures and then decide if those blocks are static elements or motion elements. But those additional levels of structure can trip you up too, until you become well-practiced at remembering that there is now sub-structure within your sketch. You have to become fluent at thinking where you should be in that sub-structure before making edits.

On the above point I have some hard-won advice: 

The most confusing thing you can do to yourself is forget that you are editing a block, then sketch more lines, then window-select them, and make another new block. It will now be a sub-block and only editable by tunneling down thru the top-level block. It will show up in the feature manager with a ‘+’ as an indented level of block, but until you notice that, the world can seem to be a strange place.

Also, if you are at the top-level sketch, then all blocks under you are drawn in grey because they are ‘not active’. Once you double-click on a block to edit it, all the normal line colors return for that block, but all the other lines and blocks ‘in the outside world’ will go grey, as they are now inactive.

So, if you need to edit a one-of-a-kind block that is a motion element, double-click and dive into your changes, no problem.

But when you want to edit a block that is a standard element, referred to multiple times, and possibly used in other part files, I would tread lightly. I always edit these using these steps to be safe:

Open a new, empty scratch part file.

  1. Start a new sketch.
  2. Import the block from the master file location.
  3. Make all changes here in this isolated environment, so there is no surprising entanglement to other blocks, or accidental pulls of other lines from the top-level assembly into this block.
  4. Close the block, and save it back to the master location, overwriting the original.
  5. Go back over to work-in-progress and tell it to update all block instances to that new master.

Making all your edits in a throwaway part file is well worth the extra steps. In a SOLIDWORKS assembly, confusion over the edit state of a referenced part would never happen, so this may seem like odd advice, but the developers wanted a SOLIDWORKS block to behave as much like an AutoCAD block as possible. In doing so, the updating of block references will always be manual.

That’s a good stopping milestone for this installment. Later topics in this series build up from this baseline knowledge. We will look at some advanced relations and commands that only work with blocks and how to use them in creating more realism in your machinery layouts. Remember, the more simulation you do, the more problems you can catch and fix early on, saving time and money.

Like what you read and missed the first one in the series?

>> Read SOLIDWORKS in Motion: Hidden Power of Motion Simulation

TriMech’s Project Engineering Group helps businesses solve their trickiest problems, whether it is in Design, Scanning, Reverse-Engineering, Finite-Element Analysis, Rigid-Body Dynamics or Fluid Dynamics. Learn more about what we can do.
Project Engineering Group