Automatic Sketch Horizontal/Vertical Relations (Line Entities)

Modified on: November 10,2025  
Rating
Downloads: 6  
Comments

Specifications

Downloads:6
Description:This macro analyzes the angle of each selected sketch line in a SolidWorks part document and automatically applies either a horizontal or vertical sketch relation. If a line's angle is close to 0 or π radians, a horizontal relation is added. If the angle is close to π/2 or 3π/2 radians, a vertical relation is added. Non-linear sketch entities are ignored. This helps enforce orthogonality in sketches for cleaner geometry and easier downstream modeling.
    Precondition: Select sketch entities
  Postcondition: All lines will be horizontal/vertical based on how close they already are to that. Rounds roughly by 45° (similar to bold relations)
SOLIDWORKS version: Any
Programming Language: SW_VBA

 


Macros might contain viruses or other security hazards. SOLIDWORKS Corporation has not verified that the macros posted on this site are safe and that they came from a trustworthy source.

Download the SOLIDWORKS Macro.

 

(Login required)  

Contributor
Other contributions from this user

Parts & Assemblies

 

 

 

Macros
Abraham Azar III

User since: 5/29/2009
Title: Engineer
 
Skills:
Design, Modeling, Illustration, Analysis
Interests:
Manufacturing, Research & Development, Experiments
 
  Report Inappropriate User
Report Inappropriate Comment