Skip to main content

Featured Post

Why I Wrote The Sheet Mechanic (And Why Calculations Aren’t Enough)

For engineers who already know the math—but still lose projects. For the last few years, I’ve been sharing technical guides here on Mechanical Design Handbook —how to size a motor, how to calculate fits, and (as you recently read) how to choose between timing belts and ball screws. But after 25 years in industrial automation, I realized something uncomfortable: Projects rarely fail because the math was wrong. They fail because: The client changed the scope three times in one week. A critical vendor lied about a shipping date (and no one verified it). The installation technician couldn’t fit a wrench into the gap we designed. University taught us the physics. It didn’t teach us the reality. That gap is why I wrote my new book, The Sheet Mechanic . This is not a textbook. It is a field manual for the messy, political, and chaotic space between the CAD model and the factory floor. It captures the systems I’ve used to survive industrial projec...
NEW RELEASE: Stop trying to be a Hero. Start being a Mechanic. Get "The Sheet Mechanic" on Amazon »
Disclosure: As an Amazon Associate, I earn from qualifying purchases.

Solid Edge Sketch Motion Simulation using Excel VBA - Part 2

To link Solid Edge variables to Microsoft Excel, we can do so by entering a formula in the variables table or by using VBA code.

Advertisement

In this post, I would like to show how easy it is to make it using the variables table. You can use the Variable Table to define and edit functional relationships between the dimensions of a design in a familiar spreadsheet format.

The Variable Table is accessed with the Variables command on the Tools menu (or the Tools tab > Variables group in modern versions). There are two types of variables: dimensions displayed in the design and variables you create directly in the Variable Table.

  • Dimension variables directly control elements of a design.
  • Variables that you create cannot directly control the design but can drive dimension variables. A user variable must be set equal to a value or mathematical expression; for example, PI = 3.14159.

Let's begin...

1. Create the Mechanism Sketch

Open Solid Edge and make a sketch as shown below.

Solid Edge Mechanism Sketch showing a cam, lever, and four-bar linkage
Figure 1: The fully constrained mechanism sketch ready for automation.

The mechanism in this example consists of a cam, lever, pull rod, and four-bar linkage. What we have to do is to make sure that when the dimension of the cam angle is changed, the entire mechanism is changed accordingly. You can simply check this by clicking at the dimension of the cam angle and rotating your mouse wheel to see if the entire mechanism is moving or not.

2. Set the Name of Variables

When you place the dimensions for a design, variables for these dimensions are placed into the variable table automatically. If the Variable Table is open, any dimension that is placed by you or the software will display in the Variable Table after the dimension is placed.

Working with the variable table open allows you to change the dimension's name that is generated by the software to a more logical name as you work. When you rename variables, the variable names should contain only letters, numbers, and the underscore character. You should not use punctuation characters.

In Solid Edge: Select Tools > Variables > Variables.

Click at the dimension you want to change the name. For this case, select the dimension of the cam angle and change "Name" to cam_angle. Select "Expose" to show this variable name to other applications as shown below.

Advertisement
Solid Edge Variable Table showing the Exposed cam_angle variable
Figure 2: Exposing the variable allows external applications to read and write to it.

3. Link Variable in Solid Edge to Microsoft Excel

You can use Microsoft Excel or other spreadsheet software to link Solid Edge variables to a spreadsheet. Before you can link variables to a spreadsheet, you must first create the variables you want in the Solid Edge document.

To successfully edit the linked Solid Edge variables from the spreadsheet later, you must open the Solid Edge and spreadsheet documents in a specific order:

  • You can open the spreadsheet document first, then open the linked Solid Edge document.
  • You can open the Solid Edge document first, then click the Edit Links command on the shortcut menu when a linked formula is selected within the variable table. You can then use the Open Source option on the Links dialog box to open the spreadsheet document.

Create a new Microsoft Excel workbook and save it. In this example, the file is named ex-solid-edge1.xls.

Excel Control File with cam angle value
Figure 3: The simple Excel interface that will drive the complex CAD geometry.

In Solid Edge: Select Tools > Variables. Select the variable named cam_angle as you created in the previous step. Enter the following formula into the "Formula" column:

@'E:\Mechanical-Design-Handbook\ex-solid-edge1.xls'!'Sheet1!R2C2'

You can see that to link to another excel workbook, just put @ at the first position then follows by the path and file name of excel file, sheet name and cell.

R2C2 means Row 2 and Column 2, which corresponds to cell B2.

Now the Solid Edge variable is linked and controlled by the cell value in Excel. If you change the value in cell B2, you will see the movement of the cam mechanism.

Watch the result in the following video clip:


Comments

Popular posts from this blog

Flywheel Construction and Design: A Guide to Energy Storage Wheels

A flywheel is a mechanical device with a significant moment of inertia used as a kinetic energy storage reservoir. Flywheels are designed to resist changes in rotational speed, helping to steady a shaft's rotation when a fluctuating torque is applied (as seen in reciprocating engines) or when the load itself is intermittent (such as in piston pumps or punching presses). Advertisement Beyond smoothing rotation, flywheels are increasingly used to produce high-power pulses for industrial experiments. In these cases, drawing the required instantaneous power from an electrical network would create unacceptable spikes. Instead, a small motor slowly accelerates the flywheel between pulses, storing energy to be released in a single high-torque event. Figure 1: Modern flywheels are sophisticated energy storage systems for steadying rotation and delivering power pulses. 1. Classification: Balance Wheels vs. Flywheel Pulleys Flywheels are gene...

Dowel Pins & Locating Pins: The Basics of Fixture Design

Dowel pins are precision cylindrical pins used for accurate part alignment in assemblies. They control position, not clamping force. This guide explains tolerances, fits, sizing rules, and design best practices. Figure 1: A typical fixture setup. Notice how dowel pins (silver) provide precise location, while bolts (not shown here) provide the clamping force. In the world of Precision Engineering , the difference between a high-quality product and a scrap part often comes down to microns. While bolts hold parts together, they are terrible at positioning them. This is where Dowel Pins and Locating Pins become essential components in industrial tooling . Advertisement What is a Dowel Pin? Dowel pins are precision-ground fasteners used to secure the relative position of two parts. They are typically machined to extremely tight tolerances (often within 0.0001 inches) and are available in materials like: Hardened Steel: For high-wea...

NEMA 17 vs NEMA 23: Torque, Speed, and When to Upgrade

When building a CNC router or upgrading a 3D printer, the first question is usually: "Is NEMA 17 enough, or do I need NEMA 23?" Most beginners look at the Holding Torque and stop there. This is a mistake. A NEMA 23 motor isn't just "stronger"—it is physically different in ways that affect your speed, your driver choice, and your machine's ability to avoid missed steps. If you choose a NEMA 17 for a heavy gantry, it is far more likely to overheat or lose steps under cutting load. If you choose NEMA 23 for a fast 3D printer, it might actually run slower than the smaller motor. This guide explains the engineering limits of each frame size. Table of Contents 1. Physical Difference (The Frame Size) 2. Torque & Speed (The Inductance Trap) 3. Driver Compatibility 4. Selection Summary Advertisement 1. Physical Difference (The Frame Size) "NEMA" is just a standard for ...