@Anonymous wrote:
.... to draw a Plines with X length which Pline consists of multiple vertices. I'll give the length X only and will select the vertices manually using a mouse.
Those other routines are great, but:
1. they are both restricted to line segments only;
2. neither honors any PLINE options while underway;
3. the resulting Polyline from Lee Mac's TLPLINE command can't have width at all;
4. the resulting Polyline from @_gile's LLP command will have width if the PLINEWID System Variable is set beforehand, but only constant width, and you don't see it as you draw, but only afterwards;
5. TLPLINE honors some Osnap modes if you have them set, but not all [at least not PERpendicular that I usually have set, under my Acad2016 here, though in quick perusal the code looks like it's intended to honor any];
6. LLP doesn't honor Osnap modes at all.
7. TLPLINE doesn't remember your maximum length to offer as default for subsequent use.
SO, I came up with the attached PlineMax.lsp with its PLML command [= PolyLine limited to Maximum Length]. It overcomes all those listed limitations. See the comments at the top of the file.
The one thing PLML doesn't do that both those others do [in different ways] is to show you where the maximum-length end will be [constantly in anticipation in LLP, where you're exceeding it in TLPLINE]. PLML simply ends the command if and when you've met or exceeded the maximum, and if you've exceeded it, takes the end back to that maximum overall length.
Many thanks to @CodeDing for the (terpri) suggestion, which got it to work as intended, and to @ВeekeeCZ for another suggestion that may end up in a revision, on this thread.
Kent Cooper, AIA