Similar questions have come up here before. Look at, for example this thread, not just the indicated solution but the rest of it, too. If that gives you something to make the rectangle, it wouldn't be hard to add the Line part -- any particular length, or should it leave the User in the Line command to pick their own other end?
Thank you very much for your thread.
Now, I could add a rectangle to MText, but I still couldn't add a vertical line to rectangle.
Please see if you can help to align line vertically center, and set the length of line to 100.
@Jyh2003 wrote:
.... I still couldn't add a vertical line to rectangle.
Please see if you can help to align line vertically center, and set the length of line to 100.
It's just a matter of finding the midpoint of the bottom edge, and drawing downward from there. If you used my routine on that thread, try:
(command "_.line"
"_none"
(list ; midpoint of bottom edge
(/ ; average X coordinates of corners
(+
(car LL); X coordinate of lower left
(car UR); X coordinate of upper right
); +
2
); /
(cadr LL); Y coordinate of lower left
); list
"_none" (polar (getvar 'lastpoint) (* pi 1.5) 100); downward by 100 units
""
); command
Or if you used Lee Mac's routine, get those coordinates differently from the 'box' variable, since it's a single list of two points -- try:
(command "_.line"
"_none" (list (/ (+ (caar box) (caadr box)) 2) (cadar box)); [same structure as above, without individual-line comments]
"_none" (polar (getvar 'lastpoint) (* pi 1.5) 100)
""
); command