Function Syntax: BR2P Version: 1 Date: 05.09.2025 BreakAll: AI+http://www.theswamp.org/index.php?topic=10370.0 Description This AutoLISP routine BR2P (Create Inside Closed Polylines Options) provides a dialog-driven interface for generating closed polylines or regions using multiple selectable workflows. Functionalities: • Command syntax: BR2P. • Displays a DCL dialog titled “Catchment area Create Inside (smallest) Closed Polylines Options.” • Provides multiple radio button choices:BreakAll – Breaks intersecting objects to create closed outlines.Boundary Offset (Creates Closed Regions) – Generates regions from offset boundaries.Region2Polyline – Converts resulting regions into closed polylines.Boundary Offset + Region2Polyline – Combines the two steps for polylines directly.BreakAll + Boundary Offset + Region2Polyline – Full process: break, regionize, and convert to polylines.Keeps Closed Polylines only – Filters for existing closed polylines, ignoring others.JoinAreas – Performs union of created areas after generation. • Remembers the last chosen option (*BR2P-last-option*) for convenience. • Executes the corresponding routine once confirmed in the dialog. • Includes Cancel option to exit without changes. Key Features: • Combines multiple closed polyline generation techniques into one dialog. • Integrates with existing helper routines like Region2Polyline and JoinAreas. • Supports step-by-step workflows or all-in-one automation depending on user choice. • Saves user preferences between runs for productivity. Function SyntaxBR2P Typical Workflow • Run BR2P. • In the dialog, select the desired method (e.g., BreakAll, Region2Polyline, JoinAreas). • Confirm with OK to execute the routine. • The program processes objects accordingly and outputs the resulting closed polylines or regions. BR2P – Mode Details BreakAll • Purpose: Breaks all intersecting linework at crossings to help form smallest closed loops suitable for catchment or room boundaries. • Input: Intersecting lines, polylines, arcs, and similar curve objects. • Process: Finds intersections, inserts break points, and splits objects at those points. • Output: A set of segmented objects ready for boundary detection or region creation. • Notes: Does not delete geometry. Best used before region or boundary operations to avoid gaps. Boundary Offset (Creates Closed Regions) • Purpose: Generates closed REGION objects by offsetting or buffering the input outlines, then forming closed areas. • Input: Lines and polylines that describe perimeters or networks. • Process: Builds candidate boundaries, creates regions, resolves overlaps when possible. • Output: One or more closed regions suitable for Boolean operations or conversion to polylines. • Notes: Region creation can fail on self intersections, tiny gaps, or very dense geometry. Region2Polyline • Purpose: Converts each selected REGION into a closed lightweight polyline with proper bulges for arcs. • Input: Region entities from previous steps or existing drawing content. • Process: Explodes region to primitives, reconstructs a closed LWPolyline, computes arc bulges. • Output: Clean closed polylines ready for editing, labeling, and measurement. • Notes: Preserves geometry fidelity for arcs and lines. Deletes source regions after conversion. Boundary Offset + Region2Polyline • Purpose: One click pipeline that creates regions from boundary offset then immediately converts them to closed polylines. • Input: Lines and polylines forming candidate boundaries. • Process: Boundary generation to regions, then automatic region to polyline conversion. • Output: Closed polylines without leaving intermediate regions behind. • Notes: Faster for production when regions are only an intermediate step. BreakAll + Boundary Offset + Region2Polyline • Purpose: Full workflow to segment geometry, derive closed regions, and finish with clean closed polylines. • Input: Messy intersecting networks of lines and polylines. • Process: Break intersections, create regions from buffered boundaries, convert to polylines. • Output: Clean closed polylines representing smallest enclosed areas. • Notes: Best for catchment or room generation from unprepared linework. Longest runtime on large drawings. Keeps Closed Polylines only • Purpose: Filters selection to retain only those polylines that are already closed and valid. • Input: Any mix of open and closed polylines. • Process: Tests closure flag and vertex continuity, discards open polylines from the result set. • Output: A curated set of closed polylines for downstream use. • Notes: Non destructive filter step to prepare inputs for union or labeling workflows. JoinAreas • Purpose: Unites multiple closed polylines into a single outline by converting to regions, applying Boolean union, then rebuilding as a polyline. • Input: Two or more closed polylines that overlap or touch. • Process: Convert to regions, union, explode back to a closed LWPolyline, restore key properties. • Output: A single closed polyline that represents the merged area. • Notes: Region Boolean operations may fail on highly self intersecting or very complex shapes. Consider simplifying first. Dialog and Memory • The last selected option is stored in *BR2P-last-option* and will be offered by default on the next run. General Warnings • Region creation and union are sensitive to gaps, overlaps, and self intersections. Clean geometry improves reliability. • Very dense drawings may require more time. Consider working in smaller selections or isolating layers first.