Function Syntax: P2L Version: 1.1 Date: 20.06.2026 6:38:51PM https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/td-p/7499765 Description 🚀 ConvertPolylineAndText2Mleader is an AutoCAD AutoLISP utility that converts selected polyline geometry into leader annotation geometry using the P2L command. 📘 The routine is useful for CAD drafting cleanup, annotation conversion, drawing standardization, and fast polyline-to-leader workflows. ⚠️ The uploaded source code creates standard AutoCAD LEADER objects. It does not create MLEADER objects and does not convert TEXT or MTEXT in the provided version. Main Command 🧰 Run P2L in the AutoCAD command line to start the polyline-to-leader conversion. 📐 Select one or more POLYLINE or LWPOLYLINE objects, then confirm the selection. Functionalities 🚀 Polyline selection - uses ssget with the *POLYLINE DXF filter to target supported polyline geometry. 🔄 Polyline-to-leader conversion - starts the AutoCAD LEADER command and recreates the selected polyline path as a leader sequence. 🧩 Vertex extraction - reads polyline points with vlax-curve-getEndParam and vlax-curve-getPointAtParam. 🟢 Closed polyline support - checks vlax-curve-isClosed to avoid adding an unnecessary duplicated closing point. 🎨 Property matching - applies MATCHPROP from the original polyline to the newly generated leader. 🧹 Source cleanup - deletes the original polyline with entdel after creating the leader. 📌 Batch processing - processes every selected polyline in the selection set during one command run. Typical Workflow 1. Type P2L in AutoCAD. 2. Select the polylines that should become leader annotation paths. 3. Confirm the selection and let the routine create leaders from the original vertices. 4. Review the generated leaders, which inherit properties from the source polylines. Result ✅ The final result is a cleaner AutoCAD drawing where selected polyline paths are replaced with leader geometry, helping CAD users standardize annotation linework and reduce manual redrawing. Important Note ⚠️ The routine deletes the original polylines after conversion. Test on a copy or use AutoCAD undo when checking the workflow. ⚠️ The provided LISP does not include text-to-MLeader conversion logic, even though the file name suggests a broader workflow. Tags 🏷️ AutoCAD, 🏷️ AutoLISP, 🏷️ Polyline, 🏷️ Leader, 🏷️ CAD automation, 🏷️ Drafting productivity, 🏷️ Annotation cleanup, 🏷️ Drawing cleanup, 🏷️ Geometry conversion, 🏷️ Match properties, 🏷️ Visual LISP, 🏷️ ActiveX