Slope_01

Short description

Sort / Purpose: Interactive slope-label placement tool for linework in Civil 3D / AutoCAD.Type of tool: Dialog-driven annotation command that creates MTEXT labels.Scope: Works on picked point pairs or on every segment of selected LINE / LWPOLYLINE / POLYLINE entities.Goal: Quickly place readable slope (and optional angle) labels with user-controlled format, prefixes/suffixes and scaling.
slope 000

Command:

Command name: SLOPE_P Entry: Type slope_p in the command line and press Enter.

Description:

What this command does: Opens a “Slope Label” dialog where you define label style (slope format, angle format, text size, horizontal/vertical scale, prefixes/suffixes, units). After confirming, you choose between two workflows:2 Points mode: Repeatedly pick point pairs; each pair gets a slope (and optional angle) MTEXT label at the midpoint, offset above/below the segment.Select Line/Segment mode: Select one or many LINE/LWPOLYLINE/POLYLINE entities; every individual segment gets a label.

Helper function: (if any)​

Main helper functions used by c:slope_p:PLTXT-MAKE-DCL – Builds the temporary DCL dialog definition file for the Slope Label UI.SPU-ParseInt / SPU-GetLightingUnits / SPU-SetLightingUnits – Small utilities to read integers safely and sync dialog “Units / Lighting” with drawing variables.SPU_UpdateAngEnable – Enables/disables the angle-format radio buttons when “Combine” is toggled.SPU_SetUnits – Applies all unit-related settings (LUNITS, AUNITS, LIGHTINGUNITS, precisions) from the dialog to the drawing.PLTXT-GetVertices / PLTXT-GetSegListFromEntity – Extract vertices and build per-segment (p0,p1) lists from LINE / LWPOLYLINE / POLYLINE entities.PLTXT-READ-VALUES – Reads text height, H-scale, V-scale and all prefix/suffix strings from the dialog and stores them in globals.PLTXT-AngToString – Converts an angle (radians) into formatted text according to the chosen angle format (deg, dms, grad, rad) and AUPREC.PLTXT-SHOW-DIALOG – Drives the dialog lifecycle: initializes tiles from current globals, wires all actions, and returns OK/Cancel result.PLTXT-CREATE-MTEXT – Core geometry/annotation engine: computes slope, text content, offset direction, and creates the MTEXT entity for one segment.PLTXT-Loop-2Pts – Implements the “2 Points” picking loop and calls PLTXT-CREATE-MTEXT for each pair.PLTXT-Loop-Ent – Implements the “Select Line/Segment” loop; for each selected entity it builds segment lists and calls PLTXT-CREATE-MTEXT on each.

Functionalities:

Key functionalities of slope_p:Dual input modes: 2-point mode or entity-selection mode, switchable in the dialog.Flexible slope formats: Percentage, per-mille, H:V ratio (x.xx:1), or V:H ratio (1:x.xx).Optional angle label: Can show angle in Degrees, DMS, Grads, or Radians; may be combined on a second line under the slope.Prefix / Suffix control: Independent prefix/suffix strings for slope and angle text (e.g., “S=” or “α=” etc.).Scaling & offset: User-set text height, horizontal/vertical scale factors (to respect vertical exaggeration), and above/below toggle for label offset from the line.Drawing units integration: Dialog can read and set LUNITS, AUNITS, LIGHTINGUNITS, and their precisions for consistent numeric formatting.Segment-wise labeling: For polylines, every segment is processed individually with its own midpoint and orientation.Robust checks: Skips zero-length segments, handles vertical slopes (INF) and guards against invalid numeric inputs.

Result:

Result / Output:Geometry: One MTEXT entity per labeled segment (or per 2-point pair), placed at the segment midpoint, offset a fixed distance along the normal, rotated to match the segment angle.Text content: Formatted slope string (with prefix/suffix) and, if enabled, a line break followed by the formatted angle string.Visual style: Uses the current text style, current layer, and the user-selected text height & width factor for consistent appearance in the drawing.User feedback: Command line messages confirm each created label and indicate when invalid or zero-length segments are skipped. Overall, running slope_p produces clear, customizable slope/angle MTEXT annotations along your design geometry with minimal repetitive work.

Images, animations etc.

slope 000
slope 000

Pixel

Additional info:

Share this page:

Leave a Reply

Page Tag: 🏷️ Polyline menu

  • Slope_01

    Short description Sort / Purpose: Interactive slope-label placement tool for linework in Civil 3D / AutoCAD. • Type of tool: Dialog-driven annotation command that creates MTEXT labels. • Scope: Works on picked point pairs or on every segment of selected LINE / LWPOLYLINE / POLYLINE entities. • Goal: Quickly place readable slope (and optional angle)…

  • CopySelection_vs.02

    Short description Comming soon … Command: Comming soon … Description: Comming soon … Helper function: (if any)​ Comming soon … Functionalities: Comming soon … Result: Comming soon … Images, animations etc. XAML code: Expand Code ↓ Select Code Copy Code <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows"> <src:RibbonToolTip x:Key="CopySelection"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: CopySelection</Bold> <LineBreak/>…

  • CopySelection_vs.01

    Short description Sort / Purpose: Create a new polyline segment copied between two picked points on an existing LWPOLYLINE, place it on a chosen layer, and optionally extend, rotate, move, and generate multiple offset copies via an interactive dialog with Apply and Undo. • Scope: Works only on a selected LWPOLYLINE, extracting the portion between…

  • Slope_Ro

    Short description🧩 Slope_Ro calculates a slope ratio and angle from two user picked points. 📏 The current routine uses a fixed vertical run reference of 12 and reduces the calculated integer ratio using the greatest common divisor. 📢 The computed slope ratio and angle in degrees are displayed in an AutoCAD alert dialog. Command:Main command:…

  • 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…

  • Region2Polyline

    Short description Purpose: Convert REGION objects into closed LWPOLYLINEs while preserving curve continuity and arc bulges Typical use: Cleanup of Boolean-created geometry or boundary extractions that output REGION entities Input object: REGION only — all selected REGIONs are processed Output format: Clean, closed LWPOLYLINE with correct bulges and segment ordering Command: Command name: Region2Polyline How…

  • Lengthen

    Short description🧩 Lengthen is an enhanced Double Extend style AutoLISP tool for extending multiple selected LINE ARC LWPOLYLINE and POLYLINE entities at both ends. 🎛️ The DCL first workflow includes object picking highlighting separate Start and End extension values a Both Ends Slot option dynamic drag preview Apply Undo Debug OK and Cancel. 🧪 The…

  • CopySelection

    Short description Purpose: Duplicate only a chosen segment of a LWPolyline between two picked points and generate it on a selected layer Supported objects: Single LWPOLYLINE only Usage style: Extract partial polyline segments and place them on a different layer using a filterable layer picker dialog Command: Command name: CopySelection How to run: Type COPYSELECTION…

  • CloseParalelPolylines

    Short description Purpose: Automatically connect two open or parallel-like entities and merge them into one continuous polyline Supported objects: LWPOLYLINE, LINE, ARC, SPLINE Usage style: Cleanup or closing gaps between two aligned open objects Command: Command name: CloseParallelPolylines How to run: Type CLOSEPARALLELPOLYLINES and press Enter User prompt: Select two open polylines, arcs, splines, or…

  • PLLengthByLayer

    Short description📏 AutoCAD LISP utility for calculating total lightweight polyline length by layer and exporting a clean TXT or CSV length report. Command:🚀 Command: PLLengthByLayer Description:📏 PLLengthByLayer is an AutoCAD AutoLISP reporting tool that scans the active drawing for all LWPOLYLINE objects and summarizes their total length grouped by layer. 🚀 Run the PLLengthByLayer command…