How to make a line perfectly horizontal or vertical in SolidWorks?

Short Answer

Use the Add Relations command in a sketch to make a line perfectly horizontal or vertical in SolidWorks. Select the line, then apply a Horizontal or Vertical relation from the PropertyManager. This is the fastest and most common professional method. Limitation: it only works properly when the entity is in an active 2D sketch.

What You Need to Know Before

Warning: If the line already has conflicting sketch relations or dimensions, SolidWorks may reject the horizontal or vertical relation or over-define the sketch. A common failure is applying the relation to a line in a 3d sketch, where standard 2D horizontal/vertical behavior may not apply as expected.

How to Make a Line Horizontal or Vertical in SolidWorks

  • Command: Add Relations

  • Shortcut: No default keyboard shortcut

  • Quick Steps:

    1. Edit the sketch, then select the line entity in the graphics area.
    2. In the left PropertyManager or from the sketch context toolbar/right-click menu, click Add Relations.
    3. Choose Horizontal or Vertical under Existing Relations, then confirm. If needed, keep Display/Delete Relations open to check for conflicting constraints.

Variables & Settings

  • Key Setting: Display/Delete Relations

    Expert Setting: Use Display/Delete Relations to review existing sketch constraints before adding Horizontal or Vertical. This helps prevent over-defined sketches and lets you remove conflicting relations such as angled, parallel, or unintended endpoint constraints.

Why it Fails

  • Cause 1 (Geometry): The selected entity is not a standard 2D sketch line, or it already has dimensions/relations that lock it at another angle.

  • Cause 2 (layers/Locks): The sketch or model state is effectively locked by external references, read-only imported geometry, or constrained blocks of sketch entities.

  • Cause 3 (Command/Logic): The relation is being applied in a 3D sketch or to multiple entities in a way that creates conflicting constraint logic.

Quick Fix & Best Practice

  • Quick Fix: Open Display/Delete Relations, remove the conflicting relation or driving dimension, then reapply Add Relations > Horizontal or Vertical.

  • Manager’s Verdict: Use sketch relations first for clean parametric control, and only add dimensions after orientation is correct. Avoid forcing horizontal/vertical on imported or heavily constrained geometry without checking existing relations.

FAQ

How do I make a line exactly horizontal in SolidWorks?
Edit the sketch, select the line, and apply a Horizontal relation with Add Relations.

Can I make multiple lines vertical at once in SolidWorks?
Yes, if the selected lines can accept the same relation without creating conflicts.

Why is SolidWorks not letting me apply a horizontal relation?
The line usually has conflicting dimensions, existing relations, or is in a 3D sketch.

.