Mark Godfrey
Usenet Archive
- Joined
- Jul 14, 2003
- Messages
- 13
- Reaction score
- 0
Not sure if this routine is for drawings that only has a dimsclae of 1. The drawing I am trying to use this in has a dimscale of 40 and when I invoke the command it asks me all the correct procedures, but then stops with this:
"Command: 40.000000" Any ideas of why this is doing this and how to fix it?
The code is below:
(defun c:smb (/ att om scl p1 p2 p3 p1x p1y p2x p2y p3x p3y blk leg) (setq att (getvar "attdia")) (setvar "attdia" 1) (setq om (getvar "orthomode")) (setvar "orthomode" 1) (setq scl (getvar "dimscale")) ;................................................................... (setq p1 (getpoint "\nIsertion point of Section Cut: ")) (if (= p1 nil)(exit)) (setq p2 (getpoint p1 "\nDirection of Section Cut: ")) (if (= p2 nil)(exit)) (setq p3 (getpoint p1 "\nLocation of Section Cut End: ")) (if (= p3 nil)(exit)) ;.................................................................... (setq p1x (car p1)) (setq p1y (car (cdr p1))) (setq p2x (car p2)) (setq p2y (car (cdr p2))) (setq p3x (car p3)) (setq p3y (car (cdr p3))) ;.................................................................... (if (and (= p1x p2x) (> p2y p1y) ) (progn (setq blk "b-cut-u") (cond ((> p3x p1x)(setq leg "bxend-u1")) ((< p3x p1x)(setq leg "bxend-u2")) ) ) ) ;.................................................................... (if (and (= p1x p2x) (< p2y p1y) ) (progn (setq blk "b-cut-d") (cond ((> p3x p1x)(setq leg "bxend-d1")) ((< p3x p1x)(setq leg "bxend-d2")) ) ) ) ;.................................................................... (if (and (= p1y p2y) (< p2x p1x) ) (progn (setq blk "b-cut-l") (cond ((> p3y p1y)(setq leg "bxend-l2")) ((< p3y p1y)(setq leg "bxend-l1")) ) ) ) ;.................................................................... (if (and (= p1y p2y) (> p2x p1x) ) (progn (setq blk "b-cut-r") (cond ((> p3y p1y)(setq leg "bxend-r2")) ((< p3y p1y)(setq leg "bxend-r1")) ) ) ) ;.................................................................... (command "insert" blk p1 scl scl "") (command "insert" leg p3 scl scl "")
;.................................................................... (setvar "orthomode" om) (setvar "attdia" att) (princ)
)
"Command: 40.000000" Any ideas of why this is doing this and how to fix it?
The code is below:
(defun c:smb (/ att om scl p1 p2 p3 p1x p1y p2x p2y p3x p3y blk leg) (setq att (getvar "attdia")) (setvar "attdia" 1) (setq om (getvar "orthomode")) (setvar "orthomode" 1) (setq scl (getvar "dimscale")) ;................................................................... (setq p1 (getpoint "\nIsertion point of Section Cut: ")) (if (= p1 nil)(exit)) (setq p2 (getpoint p1 "\nDirection of Section Cut: ")) (if (= p2 nil)(exit)) (setq p3 (getpoint p1 "\nLocation of Section Cut End: ")) (if (= p3 nil)(exit)) ;.................................................................... (setq p1x (car p1)) (setq p1y (car (cdr p1))) (setq p2x (car p2)) (setq p2y (car (cdr p2))) (setq p3x (car p3)) (setq p3y (car (cdr p3))) ;.................................................................... (if (and (= p1x p2x) (> p2y p1y) ) (progn (setq blk "b-cut-u") (cond ((> p3x p1x)(setq leg "bxend-u1")) ((< p3x p1x)(setq leg "bxend-u2")) ) ) ) ;.................................................................... (if (and (= p1x p2x) (< p2y p1y) ) (progn (setq blk "b-cut-d") (cond ((> p3x p1x)(setq leg "bxend-d1")) ((< p3x p1x)(setq leg "bxend-d2")) ) ) ) ;.................................................................... (if (and (= p1y p2y) (< p2x p1x) ) (progn (setq blk "b-cut-l") (cond ((> p3y p1y)(setq leg "bxend-l2")) ((< p3y p1y)(setq leg "bxend-l1")) ) ) ) ;.................................................................... (if (and (= p1y p2y) (> p2x p1x) ) (progn (setq blk "b-cut-r") (cond ((> p3y p1y)(setq leg "bxend-r2")) ((< p3y p1y)(setq leg "bxend-r1")) ) ) ) ;.................................................................... (command "insert" blk p1 scl scl "") (command "insert" leg p3 scl scl "")
;.................................................................... (setvar "orthomode" om) (setvar "attdia" att) (princ)
)