Announcement

Collapse
No announcement yet.

Mleader routine

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mleader routine

    Hi all, i have code attached. Im just wondering if it could be done in the same way but instead of "QLEADER" it will be "MLEADER"? I already tried changing the command to mleader but doesn't work the same. Thank you in advance. Cheers!


    (setq l_ang 90)
    (defun c:q (/ sty nm p1 p2 ateblk p3)
    (command "cmdecho" "0")
    (setq osm (getvar "osmode"))
    (setq ort (getvar "orthomode"))
    ;(command "osmode" "2")
    (setq p1 (getpoint "\nPick origin point"))
    (command "osmode" "0")
    (command "orthomode" "0")
    (setq p2 (getpoint "\nPick target" p1))
    (princ)
    (if (< (car p1) (car p2))
    (progn
    (if (< (cadr p1) (cadr p2))
    (setq p3d (- (cadr p1) (cadr p2)))
    )
    (if (< (cadr p2) (cadr p1))
    (setq p3d (- (cadr p2) (cadr p1)))
    )
    (if (< (cadr p2) (cadr p1))
    (progn
    (setq p3 (polar p2 (+ 0.0 (dtr (- l_ang))) (* p3d 1.0)))
    (command "QLEADER" p2 p3 p1 "" "" "n")
    )
    )
    (if (< (cadr p1) (cadr p2))
    (progn
    (setq p3 (polar p2 (+ 0.0 (dtr l_ang)) (* p3d 1.0)))
    (command "QLEADER" p2 p3 p1 "" "" "n")
    )
    )
    )
    )
    (if (< (car p2) (car p1))
    (progn
    (if (< (cadr p1) (cadr p2))
    (setq p3d (- (cadr p1) (cadr p2)))
    )
    (if (< (cadr p2) (cadr p1))
    (setq p3d (- (cadr p2) (cadr p1)))
    )
    (if (< (cadr p2) (cadr p1))
    (progn
    (setq p3 (polar p2 (+ 0.0 (dtr (- l_ang))) (* p3d 1.0)))
    (command "QLEADER" p2 p3 p1 "" "" "n")
    )
    )
    (if (< (cadr p1) (cadr p2))
    (progn
    (setq p3 (polar p2 (+ 0.0 (dtr l_ang)) (* p3d 1.0)))
    (command "Qleader" p2 p3 p1 "" "" "n")
    )
    )
    )
    )
    (command "osmode" osm)
    (command "orthomode" ort)
    )
    ;
    (defun dtr (a)
    (* pi (/ a 180.0))
    )
    ;
Working...
X