• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

C2P LISP: Change a Line or Arc to a Polyline in One Step

September 18, 2020

Last updated July 28, 2026

Four lines of AutoLISP that turn a line or an arc into a polyline in one step. AutoCAD can already do it — PEDIT, select the object, answer Yes to the offer to turn it into a polyline, then Enter to exit — but that is four inputs for something you may do fifty times while tidying a drawing for hatching or offsetting.

This wraps the sequence so you pick the object and it is done.

The command name is a problem

Deal with this before you load it. The file is called C2p.lsp and the listing calls it Change 2 Polyline, so you would reasonably expect to type C2P. You do not. The command the file defines is CP.

CP is not a free name. It is one of AutoCAD’s default command aliases for COPY, defined in the standard acad.pgp file that ships with the program. Loading this routine puts a command and an alias into contention over the same two letters, and which one you get is not something you want to be discovering halfway through an edit.

The fix takes ten seconds: open the file in a text editor and change the command name to C2P, which is what everyone expects anyway and is not claimed by anything else. It is one word on the first line.

What it does in practice

It asks you to select an object, then runs PEDIT on it and answers Yes to the conversion prompt. A line becomes a single-segment polyline; an arc becomes a single-segment polyline with a bulge. Once converted, the object can be given a width, joined to other polylines, offset as a unit or used as a hatch boundary.

One small rough edge: the prompt telling you to select the line or arc is printed after the selection call rather than before it, so it never appears when you would find it useful. You get a bare pick with no message. Pick straight away and it behaves.

Because it drives PEDIT, whether you end up with a lightweight or an old-style heavyweight polyline depends on your PLINETYPE setting, the same as any other conversion.

Command reference

As supplied, the command is CP. Rename it to C2P before using it, for the reason above.

How to load it

Unzip C2p.zip, edit the command name, then load the file with APPLOAD or put it in the Startup Suite. A shortcut is only a shortcut if it is always loaded. Our AutoLISP guide covers loading.

Step-by-step usage

  1. Type the command — C2P if you renamed it, CP if you did not.
  2. Pick the line or arc straight away. There is no prompt, for the reason described above.
  3. The object is now a polyline. Check the properties palette if you want to confirm it.

If you have a lot to convert at once, AutoCAD’s own PEDIT has a Multiple option that takes a whole selection, which is the better tool for bulk work. This one is for the single object you are looking at.

Compatibility notes

Nothing here can age badly. It calls PEDIT with options that have been unchanged for decades and uses two of the most basic AutoLISP functions there are.

No dialog boxes and no Express Tools calls, so nothing requires the full product; LT users on LT 2024 or later, the release that brought AutoLISP to LT, should be able to run it. See what runs on AutoCAD LT. It also makes a decent first thing to modify if you are learning — renaming its command is a real, useful edit to a real, useful program.

Download

Name: Change 2 Polyline
Description: C2p.lsp is a simple lisp program that will allow you to,
in a single step, change a line or arc into a polyline.
Type: AutoCAD AutoLISP Routine
Author: Anon
File Size: 1 Kb
Cost: Free
Worked on: AutoCAD
Download File: C2p.zip

Related routines

  • Join 2 Polylines — the obvious next step once you have converted them.
  • BreakPoint — another single-purpose command wrapper.
  • ROUGHEN — converts lines to polylines itself before roughening them.

References

  • AutoLISP: the complete guide
  • Free LISP routines library
  • AutoLISP on AutoCAD LT

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in