Slope_00

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 / NoText height — label size & offset distanceH scale — horizontal run multiplierV scale — vertical rise multiplierPrecision — decimal digits displayedFormat — % , 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 emptySLP-ParseInt — Converts string to integer, returns default if emptySLP-S — Ensures non-nil safe stringSLP-Round — Sym metric rounding for positive/negative valuesSLP-AbsInt — Returns absolute integer for slope mathSLP-GCD — Computes greatest common divisor to reduce ratiosSLP-ReduceRounded — Rounds run & rise, reduces them to smallest integers H,VSLP-Fixed — Fixed-decimal formatter enforcing trailing zerosSLP_Place — Core slope creation: computes geometry, formats text, offsets below/above, creates TEXT entity

Functionalities:

Slope formatting options — Percent, integer ratios, or decimal ratiosScale-aware slope calculation — Applies H/V multipliers before evaluating run & riseNegative slope detection — Prepends “-” when dy indicates descending elevationRobust ratio reduction — Converts values like 200:100 into 2:1 cleanlySpecial case protections — Vertical/horizontal slopes produce INF-safe labelsControlled text placement — Aligns TEXT with segment and offsets above/below automaticallySystem variable safety — Temporarily sets and restores OSMODE and LUPRECDialog-driven settings — Radio buttons ensure mutually exclusive format choices

Result:

Precise slope labels — TEXT entities created at midpoint, rotated along slope lineFormatted exactly as selected — %, H:V, V:H, H:V decimal, or V:H decimalCorrect sign & scaling — Reflects positive or negative slope and custom scaling factorsSafe & consistent — Covers extreme cases (vertical/horizontal) with stable outputReusable workflow — Settings persist per session, enabling repetitive point-pair labeling with consistency

Images, animations etc.

Pixel

Additional info:

Share this page:

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x