Picture an old drafting compass, set of dividers, etc. If you set the distance from the metal pointer to the pencil to 1 inch, you can use the pointer to follow along a line on a piece of paper and have the pencil draw a line offset from it by 1 inch. Is there a way to replicate this behavior in AutoCAD so that a polyline can be drawn offset from the crosshairs by a predetermined distance? The Mline command kind of works this way, but then you’re left with an ‘mline’ entity and two lines instead of one. The Offset command obviously would work, but as I create the new polyline I need to transition away from existing objects and draw freehand for a while, then go back to following different existing objects, etc. and I’d like to avoid having to offset in pieces and then go back and connect them all together. Thank you for the reply. I tried what you suggested, but it wasn’t really what I’m looking for. I’d prefer to be able to create the new polyline in one step, without having to go back and do any offsetting, etc. Basically to have the user pick a series of points, snapping along existing entities if appropriate, and have AutoCAD draw the polyline a predefined distance from the crosshairs. For my purposes the command could get by with only being able to draw straight segments, so if the user wants to parallel an existing curved polyline they would pick a series of short points along the polyline, and the newly drawn offset polyline would only consist of corresponding short straight segments. I hope this makes sense. Thank you all for the suggestions, and for the sample code. The closest way I’ve been able to emulate what I’m looking for is to use the mline command with the justification set to top or bottom. I like it because the user can see in real time what they’re getting, but, of course, it draws two lines and leaves you with an ‘mline’ entity. I still have a copy of the old ‘DLINE.LSP’ that AutoCAD offered years ago that sort of works like mline. I might be able to borrow some ideas from it to create something. It just draws line segments, but perhaps I can modify it to keep track of them as they are drawn and then turn them into polylines and join them all together when the user ends the command. You are very correct. Changing the mline settings per your instructions allows me to emulate exactly what I’m looking for. In the end, I need the new line to be a polyline, and I’m not very familiar with dealing with mline entities. Can an mline entity be converted via code to a polyline entity? Perhaps a solution is to make a program where it uses mline (configured per your suggestions) to allow the user to draw the geometry, then when the user terminates the command the program examines the mline, deletes it, then re-creates the geometry using a polyline instead. I will pursue this. Source.

whatsapp button