Short description
Purpose: Label slopes between two picked points using multiple numeric and ratio formats Scope: Works entirely in 2D, producing TEXT entities placed and rotated along the measured segment Workflow: Configure options in a dialog (DCL), then pick two points repeatedly to place slope labels Output style: Percent, H:V integers, V:H integers, H:V decimals (x.xx:1), or V:H decimals (1:x.xx) Defaults: Below=No, Height=1, H=1, V=1, Precision=2, Format=%
Command:
Command name: slope_p Execution: Enter slope_p to open the configuration dialog Dialog file: Uses slope_p.dcl, found by findfile or via SLP_DCL_PATH Dialog options: • Below — Yes / No • Text height — label size & offset distance • H scale — horizontal run multiplier • V scale — vertical rise multiplier • Precision — decimal digits displayed • Format — % , H:V , V:H , H:V (x.xx:1) , V:H (1:x.xx)
Description:
This routine provides a configurable slope-labeling tool for AutoCAD drawings, allowing the user to specify labeling format, measurement precision, vertical & horizontal scaling, and position offset before placing slope annotations. After configuration, the user selects two points representing the measurement line. The routine computes run and rise, detects slope direction, applies the chosen formatting rules, and places a TEXT entity at a controlled position relative to the middle of the picked segment. The process can be repeated by running the command again with the same or modified dialog settings.
Helper function: (if any)
• SLP-ParseReal — Converts string to real, returns default if empty • SLP-ParseInt — Converts string to integer, returns default if empty • SLP-S — Ensures non-nil safe string • SLP-Round — Sym metric rounding for positive/negative values • SLP-AbsInt — Returns absolute integer for slope math • SLP-GCD — Computes greatest common divisor to reduce ratios • SLP-ReduceRounded — Rounds run & rise, reduces them to smallest integers H,V • SLP-Fixed — Fixed-decimal formatter enforcing trailing zeros • SLP_Place — Core slope creation: computes geometry, formats text, offsets below/above, creates TEXT entity
Functionalities:
• Slope formatting options — Percent, integer ratios, or decimal ratios • Scale-aware slope calculation — Applies H/V multipliers before evaluating run & rise • Negative slope detection — Prepends “-” when dy indicates descending elevation • Robust ratio reduction — Converts values like 200:100 into 2:1 cleanly • Special case protections — Vertical/horizontal slopes produce INF-safe labels • Controlled text placement — Aligns TEXT with segment and offsets above/below automatically • System variable safety — Temporarily sets and restores OSMODE and LUPREC • Dialog-driven settings — Radio buttons ensure mutually exclusive format choices
Result:
• Precise slope labels — TEXT entities created at midpoint, rotated along slope line • Formatted exactly as selected — %, H:V, V:H, H:V decimal, or V:H decimal • Correct sign & scaling — Reflects positive or negative slope and custom scaling factors • Safe & consistent — Covers extreme cases (vertical/horizontal) with stable output • Reusable workflow — Settings persist per session, enabling repetitive point-pair labeling with consistency
Images, animations etc.
Additional info:
Learn more:
Open Website
Share this page:
Subscribe
Login
0 Comments
Oldest
