[vormittag]桔子 10:56:51
rtos 的返回值受 dimzin 变量的影响,使用时先把dimzin 设置为零,最后恢复。老生常谈的问题了。
[zhongguola]秋水 11:01:52
还是不行输入文字: ; 错误: 参数类型错误: fixnump: 0.0
[958620832]仁者 11:02:43
(defun c:ls ()
(setq ss (ssget) len (sslength ss) index 0)
(setq gr (grread t) mode (car gr) pt (cadr gr) pd t)
(while pd
(if (or (= mode 5) (= mode 3)) (progn
(repeat len
(setq ent (entget (ssname ss index)))
(setq pmin (cdr (assoc 10 ent)) pmax (cdr (assoc 11 ent)))
(setq pc (if (= index 0) (osnap pmin "mid")))
(setq pt (cond ((= (car pmin) (car pmax)) (list (car pmin) (cadr pt))) ((= (cadr pmin) (cadr pmax)) (list (car pt) (cadr pmin)))))
(if (or (> (car pt) (car pc)) (> (cadr pt) (cadr pc))) (entmod (subst (cons 11 pt) (assoc 11 ent) ent)))
(if (or (< (car pt) (car pc)) (< (cadr pt) (cadr pc))) (entmod (subst (cons 10 pt) (assoc 10 ent) ent)))
(setq pt1 (if (not pt1) pt))
(if (= code 5) (command "line" pt pt1 ""))
(setq index (+ index 1)))
(if (= code 3) (setq pd nil))))
(if (or (= mode 25) (= mode 11)) (setq pd nil)))
(princ))
[958620832]仁者 11:04:03
程序倒挺简单的,只是出现了一点小问题,*error* 函数中出错参数类型错误: lentityp nil
[958620832]仁者 11:04:48
什么叫参数类型错误啊,前辈们
[958620832]仁者 11:05:44
(defun c:ls ()
(setq ss (ssget) len (sslength ss) index 0)
(setq gr (grread t) mode (car gr) pt (cadr gr) pd t)
(while pd
(if (or (= mode 5) (= mode 3)) (progn
(repeat len
(setq ent (entget (ssname ss index)))
(setq pmin (cdr (assoc 10 ent)) pmax (cdr (assoc 11 ent)))
(setq pc (if (= index 0) (osnap pmin "mid")))
(setq pt (cond ((= (car pmin) (car pmax)) (list (car pmin) (cadr pt))) ((= (cadr pmin) (cadr pmax)) (list (car pt) (cadr pmin)))))
(if (or (> (car pt) (car pc)) (> (cadr pt) (cadr pc))) (entmod (subst (cons 11 pt) (assoc 11 ent) ent)))
(if (or (< (car pt) (car pc)) (< (cadr pt) (cadr pc))) (entmod (subst (cons 10 pt) (assoc 10 ent) ent)))
(setq pt1 (if (not pt1) pt))
(if (= code 5) (command "line" pt pt1 ""))
(setq index (+ index 1)))
(if (= code 3) (setq pd nil))))
(if (or (= mode 25) (= mode 11)) (setq pd nil)))
(princ))
[958620832]仁者 11:06:26
(defun c:ls ()
(setq ss (ssget) len (sslength ss) index 0)
(setq gr (grread t) mode (car gr) pt (cadr gr) pd t)
(while pd
(if (or (= mode 5) (= mode 3)) (progn
(repeat len
(setq ent (entget (ssname ss index)))
(setq pmin (cdr (assoc 10 ent)) pmax (cdr (assoc 11 ent)))
(setq pc (if (= index 0) (osnap pmin "mid")))
(setq pt (cond ((= (car pmin) (car pmax)) (list (car pmin) (cadr pt))) ((= (cadr pmin) (cadr pmax)) (list (car pt) (cadr pmin)))))
(if (or (> (car pt) (car pc)) (> (cadr pt) (cadr pc))) (entmod (subst (cons 11 pt) (assoc 11 ent) ent)))
(if (or (< (car pt) (car pc)) (< (cadr pt) (cadr pc))) (entmod (subst (cons 10 pt) (assoc 10 ent) ent)))
(setq pt1 (if (not pt1) pt))
(if (= code 5) (command "line" pt pt1 ""))
(setq index (+ index 1)))
(if (= code 3) (setq pd nil))))
(if (or (= mode 25) (= mode 11)) (setq pd nil)))
(princ)) |