# CAD Sync

> Sync bike geometry and linkage points from syn.bike into Onshape, SolidWorks or Autodesk Fusion as named variables, and draw the linkage points.

CAD sync writes your bike's geometry and linkage points into your CAD model as named variables. Dimension your frame and link sketches from those variables, and the model updates when the bike changes in syn.bike.

| Aspect | Onshape | SolidWorks | Fusion |
|---|---|---|---|
| How it connects | syn.bike runs inside your Onshape document | An add-in installed in SolidWorks, on Windows | An add-in installed in Fusion, on Windows or macOS |
| What is synced | The bike as it is in the Onshape panel, unsaved edits included | The bike as last saved to your **Private** or **Team** database | The bike as last saved to your **Private** or **Team** database |
| Where the variables go | A Variable Studio named `syn Variables` | Global variables in the active document, under **Tools > Equations** | User parameters in the active design, under **Modify > Change Parameters** |
| Units | Lengths in mm and angles in deg | Plain numbers, so the part must be in millimeters | Each value carries its unit (mm or deg) |
| How long a link lasts | Onshape does not use a link | Until SolidWorks closes, and at most 5 days | Between Fusion sessions, until it expires after 5 days or you run **Unlink** |
| Sizes | Every size, as separate variables ending `_s1`, `_s2`, ... | One configuration per size, or the first size only | For a multi-size bike, one parameter per size ending `_s1`, `_s2`, ..., plus one that follows the size chosen in **Switch Size**. A single-size bike gets plain names |
| Linkage points | Shifted by the offset variables | Real coordinates | Real coordinates |
| Shock and tire variables | Yes | No | No |
| **Draw Linkage Points** | A button in the panel, drawing on the Right plane of the open Part Studio | A command, drawing on the Right Plane or a plane you pick | A command, drawing on the YZ plane, Fusion's **Right** view, or a plane you pick |

To get each tool connected, see [Onshape Setup](https://syn.bike/docs/cad-sync/onshape.md), [SolidWorks Add-in](https://syn.bike/docs/cad-sync/solidworks.md) and [Autodesk Fusion Add-in](https://syn.bike/docs/cad-sync/fusion.md).

## Link a Bike

The SolidWorks and Fusion add-ins link to one saved bike with a one-time password that you generate in the web app. Onshape does not use this step.

![The Access Controls and Export section of the Layout tab, with the Setup CAD Sync button at the bottom](https://syn.bike/images/docs/cad-sync-setup-light.png)

1. In syn.bike, load the bike and save it to your **Private** or **Team** database. Edits you have not saved are not synced. A bike from the **Public** database or a local file gets a warning instead of a password, and so does a bike model that has not been saved: save the bike, then generate the password again. See [Loading and Saving](https://syn.bike/docs/loading-and-saving-bikes.md).
2. Open the **Layout** tab, expand **Access Controls and Export**, and click **Setup CAD Sync**.
3. Click **Generate OTP**, then click the copy icon beside the password. It works once and expires after 3 minutes. Closing the dialog clears it, so copy it first.
4. Open the file you want the variables in, a part in SolidWorks or a design in Fusion, and click **Setup Bike Link**.
5. Paste the password into **One Time Password**.
6. **SolidWorks only:** tick **Use Configuration per Size** if you want one SolidWorks configuration for each size of the bike. Read [Sizes in SolidWorks](#sizes-in-solidworks) before you tick it on a part that already has configurations.
7. Confirm the page with the green check mark in SolidWorks, or click **OK** in Fusion.

A box names the linked bike and the first sync starts in the active document. In SolidWorks it can take up to a minute. In Fusion, if no parametric design is open, the add-in links the bike and syncs nothing.

### How Long a Link Lasts

Links expire 5 days after they are created. A SolidWorks link also ends when you close SolidWorks. Fusion keeps the link between sessions until it expires or you run **Unlink**.

After a link ends, generate a new password and run **Setup Bike Link** again. Your variables and sketches stay in the part or design.

Saving the bike under a new **Version** creates a separate bike, which needs its own link.

### Manage CAD Links

The list icon beside **Setup CAD Sync** opens **Current Bikes with CAD Access**, which lists your links with the bike, the CAD tool, when each was last used and when it expires.

Click the trash icon to remove a link. The add-in's next sync then fails, and you need a new link. For what a linking or sync message means, see [Messages](https://syn.bike/docs/messages.md).

**Unlink** in the Fusion add-in removes the link from your computer only, so it stays in this list until you remove it here.

## Sync the Variables

Onshape syncs from the syn.bike panel into a Variable Studio. SolidWorks and Fusion sync with the add-in's **Sync All Variables** and **Sync Changes** commands.

### Sync to the Variable Studio

In Onshape, click the sync icon at the right of the top bar (its tooltip reads **Sync to Variable Studio**). Every size of the bike is synced each time.

The first sync creates a Variable Studio named `syn Variables` in the document and workspace you have open. Do not rename it, or the next sync creates a new one.

Turn on **Auto Sync** to sync as you work. It syncs once when you turn it on, then after each change to a point, a geometry value, a tire diameter or **Shock Length:**. Loading a bike, or changing **Shock Ext. Length:** alone, does not trigger it, so click the sync icon in those cases.

> [!WARNING]
> Every sync rewrites the whole `syn Variables` Variable Studio. Variables you add to it yourself are removed, and `syn_shock_compression` returns to 0 mm. Only `syn_x_offset` and `syn_y_offset` keep a value you set, as described under [Offset Variables](#offset-variables). Keep your own variables in a separate Variable Studio.

### Use the Variables in Onshape

Reference a variable in a dimension or feature with the `#` prefix, for example `#syn_reach_s1` or `#syn_p4_x`.

Point variables include the offsets, so dimension pivots from the datum described under [Offset Variables](#offset-variables). The sketch from [Draw Linkage Points](#draw-linkage-points) is a worked example. Tire diameters are `#syn_tire_diameter_rear` and `#syn_tire_diameter_front`.

### Sync All Variables

In SolidWorks and Fusion, **Sync All Variables** downloads the saved bike and writes it into the active file: as global variables under **Tools > Equations** in SolidWorks, and as user parameters under **Modify > Change Parameters** in Fusion.

There are 32 linkage point variables (`syn_p0_x` to `syn_p15_y`) and 21 geometry variables such as `syn_reach` and `syn_hta`.

Every sync writes into whichever document is active, so check which window is in front before you sync.

Only values that differ are written, and a box then lists what changed as `variable: old > new`. A value you typed over by hand is set back to the bike's value. In SolidWorks, that is a value typed over in the active configuration.

SolidWorks asks before writing anything the first time you sync into a part that has no linkage point variables, and Fusion asks before downloading anything the first time you run **Sync All Variables** in a design that has none. **Cancel** leaves the part or design untouched. In Fusion, **Sync Changes** stops with a message instead when the parameters are missing.

**SolidWorks:** if a sketch is open when you sync, the values are written but the model is not rebuilt until you leave the sketch.

**Fusion:** each sync is a single undo step, so one **Undo** takes back the whole sync. If Fusion refuses any value, the whole sync is undone and nothing is changed.

### A Design Synced From Another Bike

In Fusion, each design remembers which bike it was last synced from. When that is not the linked bike, a sync or **Draw Linkage Points** asks before overwriting the design's syn variables with the linked bike. **OK** goes ahead, and **Cancel** changes nothing. The checks that can stop a sync run before it asks, so once you click **OK**, the sync goes ahead. Renaming a bike in syn.bike does not make it a different bike.

### Sync Changes

**Sync Changes** is for the edit-save-sync loop. The two add-ins decide what to write differently.

**SolidWorks:** it is the quicker of the two sync commands. It writes only what changed in the saved bike since the last sync, and shows no summary when it succeeds. If you work in two parts, or you are not sure a part is current, run **Sync All Variables** instead. If an earlier sync did not finish writing, the next **Sync Changes** runs as **Sync All Variables**.

**Fusion:** it downloads the saved bike, compares it with the design's own `syn_` parameters, and writes only the values that differ. It shows nothing when it succeeds or when nothing has changed.

- Like **Sync All Variables**, it sets any `syn_` value you typed over by hand back to the bike's value, even when that value did not change in syn.bike.
- It needs a design that already has all the `syn_` parameters, so run **Sync All Variables** once first, and again when the bike gains a size.

### Units and Coordinates

**Onshape:** lengths arrive in mm and angles in deg, so no unit conversion is needed. Point variables include the offsets, as described under [Offset Variables](#offset-variables).

**SolidWorks:** the variables are plain numbers with no unit: lengths are millimeter values and angles are degree values. Keep the part's length unit set to millimeters (**Tools > Options > Document Properties > Units**). In a part set to inches, `syn_reach` = 475 would drive a dimension to 475 inches.

**Fusion:** every value is written with its unit, for example `412.5 mm` or `64.5 deg`, so it is right whatever units the design uses.

In SolidWorks and Fusion, linkage point values are the real coordinates relative to the bottom bracket, X positive toward the front of the bike and Y positive up, so most of them have a negative X. They are not shifted by the offsets that the Onshape sync applies.

## Sizes

Each tool writes a bike with more than one size its own way.

### Sizes in Onshape

Each name is followed by `_s` and the size number, counting from 1 in the order of the size columns in the **Geometry** tab: `syn_reach_s1`, `syn_reach_s2`, `syn_reach_s3`. A bike with one size still gets `syn_reach_s1`.

### Sizes in SolidWorks

In SolidWorks, the names have no size suffix. Sizes become configurations.

**Use Configuration per Size**, on the **Setup Bike Link** page, decides how a bike with more than one size is written. It is off each time SolidWorks starts.

- **Cleared**, or a bike with one size: the sync writes the geometry of the bike's first size.
- **Ticked**, and a bike with more than one size: each size becomes a SolidWorks configuration named after the size. Geometry variables get their own value in each configuration. Linkage point variables are the same in all of them.

> [!WARNING]
> The sync renames the part's existing configurations, in order, to the bike's size names: the first configuration takes the first size's name, the second takes the second, and so on. Configurations are added if the part has fewer than the bike has sizes. Turn this on only in a part whose configurations are meant to be the bike's sizes.

If you start with the box cleared and turn it on later, delete all the `syn_` variables in **Tools > Equations** and run **Sync All Variables**.

### Sizes in Fusion

- **One size:** each geometry parameter holds its value, for example `syn_reach` = `475 mm`.
- **More than one size:** each size gets its own parameter, ending `_s` and the size number: `syn_reach_s1`, `syn_reach_s2`, `syn_reach_s3`. Sizes count from 1 in the order of the size columns in the **Geometry** tab. `syn_reach` itself holds the name of one of them, such as `syn_reach_s2`, so it always shows the active size.

Linkage point parameters are the same in every size. Build your model on `syn_reach` and the other unsuffixed names, and it follows the size you choose with [Switch Size](#switch-size). A new design starts on the first size, and later syncs keep the size number the model is showing. If the bike no longer has that many sizes, the model goes back to the first size. Fusion configurations are not used.

When the bike gains a size, including a single-size bike that now has several, run **Sync All Variables** to add the new parameters; until then **Sync Changes** stops. Losing, renaming or reordering sizes syncs with either command. Parameters for a size the bike no longer has are left in the design, and you can delete them in **Modify > Change Parameters**.

### Switch Size

**Switch Size** picks which size a multi-size Fusion design shows. Choose the size under **Size** and click **OK**. It downloads nothing: the 21 geometry parameters are pointed at that size's values, which are already in the design. Each switch is one undo step.

## Draw Linkage Points

**Draw Linkage Points** adds a sketch of the linkage points, each one dimensioned from the synced variables. When you sync, the sketch moves with the bike, because its dimensions read the variables. In Onshape and Fusion the sketch is named `syn Linkage Points`.

### Draw in Onshape

Every run syncs the bike first, exactly as the sync icon does, so the sketch is drawn from the bike's current values. See [Sync to the Variable Studio](#sync-to-the-variable-studio).

1. Open a Part Studio tab.
2. Click the linkage icon beside the sync icon (its tooltip reads **Draw Linkage Points**).

The sketch is drawn on the Right plane.

#### Running It Again

When the Part Studio already holds a sketch named `syn Linkage Points`, the next run redraws that sketch instead of adding a second one. Run it again after you change the bike's **Linkage Setup**, so that the lines and circles match. A change to a point's position needs only a sync.

A redraw replaces the points, lines, circles and dimensions that syn.bike drew, and puts back any of them that you deleted or changed. Geometry and constraints that you added are kept, and so is the plane if you moved the sketch. If the redraw cannot be solved, the sketch is left as it was, although the bike has been synced. This happens when `syn Variables` is no longer inserted into the Part Studio, or when geometry you added is attached to a point or line the bike no longer has. Insert the Variable Studio or detach the geometry, then run **Draw Linkage Points** again.

To keep a sketch as it is and draw a fresh one beside it, rename it. Only a sketch named `syn Linkage Points` is redrawn.

### Draw in SolidWorks or Fusion

The sketch uses the values last synced into the part or design, so sync first if the bike has changed.

1. Open the part in SolidWorks, or the design in Fusion, and close or finish any sketch you are editing.
2. Click **Draw Linkage Points**.
3. Pick a plane or a flat face for the sketch.
   - **SolidWorks:** the Right Plane is selected already.
   - **Fusion:** under **Plane**, pick a construction plane or a flat face. The YZ plane, which faces Fusion's **Right** view, is selected already.
4. Confirm with the green check mark in SolidWorks, or click **OK** in Fusion.

Every run draws into a new sketch, so running it twice gives you two sets of points.

In Fusion, a drawing is a single undo step, and a drawing that fails part-way leaves nothing behind. If the design does not have the linkage point parameters yet, or was last synced from a different bike, the command offers to sync first.

### What the Sketch Contains

Every tool draws:

- Lines joining the points of each link, following the bike's **Linkage Setup** in syn.bike.
- A 20 mm circle at each point where a link pivots on the frame. In Fusion, its diameter is not tied to the bike, so you can change it.

A point at (0, 0) that the linkage does not use is skipped. The lines and circles are construction geometry, so they guide your design without becoming part of a feature's profile.

**Onshape** also draws:

- A fixed point at the sketch origin.
- The offset datum, dimensioned from the origin point by `#syn_x_offset` and `#syn_y_offset`.
- A horizontal and a vertical dimension for each linkage point, the bottom bracket included, measured from the datum and driven by `#syn_p<index>_x` and `#syn_p<index>_y`, such as `#syn_p4_x` and `#syn_p4_y` for point 4.

**SolidWorks and Fusion** draw the points at their real coordinates relative to the sketch origin, with the bottom bracket fixed at the origin. Every point except the bottom bracket is dimensioned from the offset datum, described under [Offset Variables](#offset-variables). Fusion gives each point a horizontal and a vertical dimension: for point 3 they are named `syn_p3_x_dim` and `syn_p3_y_dim` and driven by `syn_p3_x + syn_x_offset` and `syn_p3_y + syn_y_offset`.

## Geometry Variables

Each row of the **Geometry** tab syncs as one variable, except **Crank Length**, which is not synced. Lengths are in mm and angles in deg.

SolidWorks syncs a shorter list, and Fusion syncs the SolidWorks list under the same names. The names below have no size suffix: see [Sizes](#sizes) for the suffixes that Onshape and multi-size Fusion bikes add, and [Units and Coordinates](#units-and-coordinates) for how each tool writes units.

An en dash (–) in the table means that value is not synced to that CAD system.

| Geometry tab row | Onshape | SolidWorks and Fusion | Units |
|---|---|---|---|
| **Reach** | `syn_reach` | `syn_reach` | mm |
| **Stack** | `syn_stack` | – | mm |
| **Head Tube Angle** | `syn_hta` | `syn_hta` | deg |
| **Head Tube Length** | `syn_htl` | `syn_htl` | mm |
| **Fork Length** | `syn_fork_length` | `syn_forkLength` | mm |
| **Fork Offset** | `syn_offset` | `syn_offset` | mm |
| **Lower Headset Stack** | `syn_lower_headset` | `syn_lowerHeadset` | mm |
| **Trail** | `syn_trail` | – | mm |
| **Horz. Top Tube** | `syn_htt` | – | mm |
| **Front Center** | `syn_fc` | – | mm |
| **Rear Center** | `syn_rc` | – | mm |
| **Chainstay** | `syn_cs` | `syn_cs` | mm |
| **Wheelbase** | `syn_wheelbase` | – | mm |
| **Seat Tube Angle Eff.** | `syn_sta_eff` | `syn_sta_eff` | deg |
| **Seat Tube Angle Act.** | `syn_sta_act` | `syn_sta_act` | deg |
| **Seat Tube Length** | `syn_stl` | `syn_stl` | mm |
| **Nominal Saddle Height** | `syn_nsh` | `syn_nsh` | mm |
| Seatpost insertion | `syn_insertion` | `syn_insertion` | mm |
| **BB Drop** | `syn_bb_drop` | `syn_bbDrop` | mm |
| **BB Height** | `syn_bb_height` | – | mm |
| **BB Horz. Offset** | `syn_bb_offset` | `syn_bbOffset` | mm |
| **Upper Headset Stack** | `syn_upper_headset` | `syn_upperHeadset` | mm |
| **Stem Length** | `syn_stem_length` | `syn_stemLength` | mm |
| **Stem Spacer** | `syn_stem_spacers` | `syn_stemSpacers` | mm |
| Stem stack height | `syn_stem_stack` | `syn_stemStack` | mm |
| **Bar Rise** | `syn_bar_height` | `syn_barHeight` | mm |
| **Seated Fit** | `syn_seated_fit` | – | mm |
| Center of gravity, X and Y | – | `syn_cogX`, `syn_cogY` | mm |

**Rear Center** is the horizontal distance from the bottom bracket to the rear axle, and it is the one you type in. **Chainstay** is the straight-line distance between the same two points, which syn.bike calculates.

Seatpost insertion and stem stack height have no row in the **Geometry** tab. The center of gravity is the **COG** point in **Kinematic Points**, measured from the bottom bracket.

## Shock Variables

Shock variables are synced to Onshape only.

| Variable | Value | Units |
|---|---|---|
| `syn_shock_length` | **Shock Length:** from **Fork and Shock Info** | mm |
| `syn_shock_ext_length` | **Shock Ext. Length:** from **Fork and Shock Info** | mm |
| `syn_shock_compression` | Always synced as 0 | mm |
| `syn_total_shock_length_active` | `#syn_shock_length + #syn_shock_ext_length - #syn_shock_compression` | mm |

To see your model with the shock compressed, type a value into `syn_shock_compression` in the Variable Studio. The next sync sets it back to 0 mm.

## Tire Variables

Tire variables are synced to Onshape only. They hold the bike's own tires from **Drivetrain Info** in the **Layout** tab, one value for every size, so the names have no size suffix. A flip chip that replaces a tire diameter does not change them.

| Variable | Value | Units |
|---|---|---|
| `syn_tire_diameter_rear` | **Tire Diameter Rear:** | mm |
| `syn_tire_diameter_front` | **Tire Diameter Front:** | mm |

## Offset Variables

Most linkage points sit behind or below the bottom bracket, and CAD length dimensions cannot be negative. The two offsets shift the points into positive space.

| Variable | Default | Shifts |
|---|---|---|
| `syn_x_offset` | 500 mm | Point X values |
| `syn_y_offset` | 100 mm | Point Y values |

In SolidWorks and Fusion, the point variables hold the real coordinates and the sync never writes the offsets. Only **Draw Linkage Points** uses them.

### Offsets in Onshape

In Onshape, the offset is part of every point variable. A rear axle 440 mm behind the bottom bracket syncs as `syn_p1_x` = `-440 mm + #syn_x_offset`, which evaluates to 60 mm. Dimension your sketch from a datum placed 500 mm behind and 100 mm below the bottom bracket, or subtract the offset where you need the real coordinate. [Draw Linkage Points](#draw-linkage-points) draws this datum for you, as a worked example.

To move the datum, change `syn_x_offset` or `syn_y_offset` in the Variable Studio. A sync keeps a value you set as a plain number of millimeters, such as `250 mm`, and shifts every point by it. Anything else, such as an expression or another unit, returns to the default. Keep each offset larger than the distance from the bottom bracket to the furthest point behind or below it, so that no point variable goes negative.

### Offsets in SolidWorks

Every point except the bottom bracket is dimensioned from the offset datum, a construction point at `-syn_x_offset`, `-syn_y_offset`.

**Draw Linkage Points** creates `syn_x_offset` (500 mm) and `syn_y_offset` (100 mm) if the part does not have them, and never overwrites them. Each must be a plain number of millimeters greater than 0.

If a point lies further behind the origin than `syn_x_offset`, or further below it than `syn_y_offset`, the command stops and names the point. Raise the variable in **Tools > Equations** and run the command again.

### Offsets in Fusion

Every point except the bottom bracket is dimensioned from the offset datum, a reference point at `-syn_x_offset`, `-syn_y_offset` from the sketch origin. It gives the sketch the same dimensions as one drawn by the SolidWorks add-in.

**Draw Linkage Points** creates `syn_x_offset` (500 mm) and `syn_y_offset` (100 mm) if the design does not have them, and a sync never overwrites them. If you change one, use **Modify > Change Parameters** and keep it a plain number of millimeters, such as `500 mm`. Unlike in SolidWorks, a point further behind or below the origin than the offsets is still drawn correctly.

## Linkage Point Variables

Each linkage point syncs as two variables, `syn_p<index>_x` and `syn_p<index>_y`, in mm. Coordinates are measured from the bottom bracket, with X positive toward the front of the bike and Y positive upward. The numbers match the **Kinematic Points** table in the **Layout** tab, plus the offsets in Onshape.

| Index | Variables | Label in Kinematic Points | Point |
|---|---|---|---|
| 0 | `syn_p0_x`, `syn_p0_y` | `BB` | Bottom bracket, always (0, 0) |
| 1 | `syn_p1_x`, `syn_p1_y` | `R. Wheel` | Rear axle |
| 2 | `syn_p2_x`, `syn_p2_y` | `Shock 1` | Shock end 1 |
| 3 | `syn_p3_x`, `syn_p3_y` | `Shock 2` | Shock end 2 |
| 4 | `syn_p4_x`, `syn_p4_y` | `Frame - L1` | Link 1 pivot on the frame (the main pivot) |
| 5 | `syn_p5_x`, `syn_p5_y` | `L1 - L2` | Pivot between link 1 and link 2 |
| 6 | `syn_p6_x`, `syn_p6_y` | `L2 - L3` | Pivot between link 2 and link 3 |
| 7 | `syn_p7_x`, `syn_p7_y` | `L3 - Frame` | Link 3 pivot on the frame |
| 8 | `syn_p8_x`, `syn_p8_y` | `L4 Start` | Link 4 mount, on the part chosen in **Link 4 Attached To:** |
| 9 | `syn_p9_x`, `syn_p9_y` | `L4 - L5` | Pivot between link 4 and link 5 |
| 10 | `syn_p10_x`, `syn_p10_y` | `L5 Start` | Link 5 mount, on the part chosen in **Link 5 Attached To:** |
| 11 | `syn_p11_x`, `syn_p11_y` | `Idler` | Idler pulley |
| 12 | `syn_p12_x`, `syn_p12_y` | `Brake 1` | Pivot between the two brake arm links |
| 13 | `syn_p13_x`, `syn_p13_y` | `Brake 2` | Brake arm mount, on the part chosen in **Brake Arm Attached To:** |
| 14 | `syn_p14_x`, `syn_p14_y` | `DAQ Sensor 1` | DAQ sensor end 1 |
| 15 | `syn_p15_x`, `syn_p15_y` | `DAQ Sensor 2` | DAQ sensor end 2 |

Which part of the bike each shock end, the rear wheel and the bottom bracket ride on is set in **Linkage Setup**. See [Set Up the Linkage](https://syn.bike/docs/creating-linkages.md#set-up-the-linkage).

### Common Linkage Configurations

All 16 points are written on every sync. A point the linkage does not use normally holds 0, which in Onshape reads as the bare offset (by default 500 mm for X and 100 mm for Y).

| Bike setup | Points in use |
|---|---|
| Every bike, including **Single Pivot** | 0 to 4 |
| **Four Bar** | 0 to 7 |
| **Six Bar** | 0 to 10 |
| **Uses Idler:** turned on | adds 11 |
| **Uses Brake Arm:** turned on | adds 12 and 13 |
| **Uses DAQ Sensor:** turned on | adds 14 and 15 |

Points 14 and 15 are the two mounts of a travel sensor placed on the bike model. See [Model the Sensor on the Bike](https://syn.bike/docs/data-acquisition/overview.md#model-the-sensor-on-the-bike).
