Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Kent1Cooper
en respuesta a: Anonymous

In simplest terms, here's one way:

 

(defun C:TEST (/ pt1 pt2)
  (command
    "_.rectang"
    (setq pt1 (getpoint "\nCorner of rectangle: "))
    (setq pt2 (getcorner pt1 "\nOpposite corner: "))
    "_.dtext" "_mc" "_m2p" pt1 pt2 "" ""
  ); command
  (princ)
)

 

It assumes you want to draw the rectangle by simple opposite corners, and not call for any of the options within this routine [filleted corners, etc.], and that the Text would be at 0° rotation and in whatever the current Style is, and that Style does not have a fixed height.  Variations in such things can be accounted for.

Kent Cooper, AIA