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.