@Anonymous wrote:
I creat the layer as current firstly, and then draw a line in "PL' command. When draw a second line, it switch automatically to other layer. ....
So you're not drawing a Line, after all. PL is [by default] the command alias for the PLINE command, which would simply start a Polyline [on the current Layer], and a Polyline is a different entity type than a Line.
It sounds like you have a custom definition of a command named PL that is not just the PLINE command called by the default PL command alias. Do you have an acaddoc.lsp file that contains (defun C:PL ... in it? If you're not sure, put (findfile "acaddoc.lsp") in at the command line, and if that returns something other than nil, it will tell you where it is -- open that file and look for a command definition.
If you force it to use AutoCAD's basic command, by typing .PLINE [with the preceding period/decimal], does it do the same thing? If it works normally without changing the Layer, then you do have a custom-defined PL command that is changing the Layer.
Kent Cooper, AIA