[434939575]模型 22:41:53
请教一个问题:;;;提取矩形的长度和宽度程序.
;;;编写日期2003-09-18
;;;编写: BDYCAD
(DEFUN C:Y01()
(princ "请选取一个矩形:")
(SETQ A (entsel))
(SETQ AS (car A)
ac (ENTGET AS)
AF (CDR (ASSOC 10 AD)))
(setq n 0)
(repeat (length ac)
(setq qend (nth n ac))
(if (= (car qend) 10)
(setq one (cdr qend))
(setq n (1+ n))))
(setq tow (cdr (nth (+ n 4) ac)))
(setq trhee (cdr (nth (+ n 8) ac)))
(setq fou (cdr (nth (+ n 12) ac)))
(SETQ XLENGTH (distance one tow)) ;; ;
(setq ylength (distance one fou))
(princ "
矩形的长度=" )(princ xlength)
(princ "
矩形的宽度=" )(princ ylength)
(princ))
[434939575]模型 22:42:36
AF (CDR (ASSOC 10 AD)))。里面 的AD怎么理解。
[alwtyp][alwtyp] 22:44:47
错了吧,应该是 (CDR (ASSOC 10 Ac)))才对
[434939575]模型 22:46:28
谢谢;但是命令也没报错。
[alwtyp][alwtyp] 22:49:38
[qqimg]oldimg/{CD2713FD-BC3A-784C-7597-37BE39D5C591}.jpg[/qqimg]
[434939575]模型 22:51:26
我刚才试了把那个AD,随便修改都不出错。
[434939575]模型 22:55:17
谢谢 |