@Anonymous.melhem wrote:
....
What i need is the length/dimension of a line , written in a text in this form "L = " then the value of the dimension . Why would i want it in the command line ?!?! , I dont know how this is confusing that you dont understand it ...
It's still a question of what you mean by "written." The command line is where informational reporting is done by commands like LIST and ID, so it makes perfect sense that you might want it there. Your original question wanted it to "give me its length," which to me sounded exactly like that kind of reporting.
To illustrate, load these up. They're simplified, for LINE entities only for the present, and don't control for whether you actually selected a Line, so you have to do what they ask, but just to demonstrate some possibilities in how the information could be "written":
(defun C:RLL-C (/ lin); = Report Line Length - Command line
(setq lin (car (entsel "\nSelect Line for length report: ")))
(prompt (strcat "\nL = " (rtos (vlax-curve-getEndParam lin))))
(princ)
)
(defun C:RLL-A (/ lin); = Report Line Length - Alert
(setq lin (car (entsel "\nSelect Line for length report: ")))
(alert (strcat "L = " (rtos (vlax-curve-getEndParam lin))))
(princ)
)
If you use the RLL-C command [I picked the red line with the little blip on it], you get this at the Command line:

If you use the RLL-A command on the same Line, you get this out in the middle of the screen:

If you mean a Text entity, which was not part of the original question [which may explain why we haven't been thinking along those lines even though the word text has been used in later Posts], then you would have to give some direction on how it should appear [middle-justified on the midpoint of the Line? above it similar to the look of the Dimensions below? aligned with the Line's direction or always horizontal? text size determined by what? etc., etc.].
Or perhaps, since you have now used the word "dimension," you want one of those? If you make a Dimension Style with "L = " as a prefix, and with both extension lines and both dimension lines suppressed, you can use a Linear or Aligned Dimension and get this, drawn in:

That's an actual Dimension entity, with the "L = " part built into it, and unlike Text, it will update its length information content if the Line is Stretched. And with an Aligned Dimension, it will even follow the direction of a non-orthogonal Line:

and both its informational content and direction will adjust themselves automatically if the Line is adjusted by Stretching:

Kent Cooper, AIA