;从CAD图和别的文本中读取数据,写入到指定的文本中 (defun c:dd () (if (setq lluu (open "c:/ddm.ini" "r")) (progn (setq wjlujin (read-line lluu)) (close lluu)) ) (setq name(getvar"dwgname")) (setq fn(getfiled "请指定输出的文件名称:" wjlujin "" 1)) (setq fi(open fn "w")) (princ "图 名: " fi) (princ name fi) (princ "\n" fi) (princ "文本路径: " fi) (princ wjlujin fi) (princ "\n" fi) (setq qq (getstring "请输入你想说的话:")) (princ "人机对话: " fi) (princ qq fi) (princ "\n" fi) (setq y (entsel "\n请选择对象:")) (setq q (entget (car y))) (setq i (assoc 11 q)) (setq b (list q i)) (princ "图形元素: " fi) (princ b fi) (princ "\n" fi) (princ "---------------------从别的文本中读取的数据-------------------- " fi) (princ "\n" fi)
(setq yy (strcat "(文本来自来" "d:\\dd.txt" ")")) (princ yy fi) (princ "\n" fi) (setq xt "d:\\dd.txt") (setq f (open xt "r")) (setq cs (getint "\n请输入读文本的行数:")) (setq x 1) (while (<= x cs) (setq qq (read-line f)) (princ qq fi) (princ "\n" fi) (setq x (1+ x))
) (close f) (princ "\n" fi) (princ "\n" fi) (princ "\n" fi) (princ "\n" fi) (princ "---------------------------------------------韦波立作 联系方式QQ35587325" fi) )
|