- 积分
- 451
- 明经币
- 个
- 注册时间
- 2002-11-15
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2005-6-27 12:16:00
|
显示全部楼层
(defun c:zbzh() (SETQ layer1 "zdh") (SETQ filename1 (GETVAR "dwgname") ;提取图形文件名 filename1 (SUBSTR filename1 1 (- (STRLEN filename1) 4)) ;取消.DWG filename1 (STRCAT (GETVAR "dwgprefix") filename1 ".dat");提取文件夹并转换dat ) (IF (NOT (SETQ fp1 (OPEN filename1 "w"))) ;打开文件如果没有该文件就建立,如果有覆盖它 (ALERT (STRCAT "错误:\n\t不能打开文件<" filename1 ">."));显示警告框(字符串加文件名) ) (SETQ OBJ (SSGET "x" (LIST (CONS 0 "POINT") (CONS 8 layer1)))) ;;; (setq obj(ssget)) (IF(/= OBJ nil) (PROGN (setq num(sslength obj)) (setq r 0) (REDRAW) (REPEAT num (setq nam(ssname obj r)) (setq aa(entget nam)) (setq BBB(assoc 0 aa)) (SETQ BB(CDR BBB)) (setq r (+ r 1)) (IF (/= "point" BB) (PROGN (SETQ aa1(assoc 10 aa)) (SETQ aa2(cdr aa1)) (SETQ x1(rtos(car aa2) 2 3)) (SETQ y1(rtos(cadr aa2) 2 3)) (SETQ z1(rtos(caddr aa2) 2 3)) (WRITE-LINE(STRCAT ", ,"x1","y1","z1) fp1) (redraw) ) ) ) ) ) (CLOSE fp1) ) |
|