|
发表于 2004-5-25 15:07:00
|
显示全部楼层
请教,为什么我这样做不行呢?
;由文本文件导入点坐标
(defun c:fD ()
(setq f (getfiled "请选择数据文件:" "f:/" "txt" 8))
(setq fF (open f "r"))
(setq tj "T")
(if (= tj T)
(repeat 1
(
(setq F1 (read-line ff))
(setq tj (atom F1))
(setq x1 (substr F1 1 8))
(setq y1 (substr F1 11 7))
(setq x1 (atof x1))
(setq y1 (atof y1))
(setq p1 (list x1 y1))
(setq x2 (substr F1 20 8))
(setq y2 (substr F1 29 7))
(setq x2 (atof x2))
(setq y2 (atof y2))
(setq p2 (list x2 y2))
(setq x3 (substr F1 38 8))
(setq y3 (substr F1 47 1))
(setq x3 (atof x3))
(setq y3 (atof y3))
(setq p3 (list x3 y3))
(setq x4 (substr F1 50 6))
(setq y4 (substr F1 57 1))
(setq x4 (atof x4))
(setq y4 (atof y4))
(setq p4 (list x4 y4))
(princ "\n左上角点坐标:")
(princ p1)
(princ "右上角点坐标:")
(princ p2)
(princ "\n右下角点坐标:")
(princ p3)
(princ "左下角点坐标:")
(princ p4)
(command "layer" "s" "dim" "")
(Command "dimaligned" p1 p2 "@0,500")
(Command "dimaligned" p2 p3 "@500,500")
(Command "dimaligned" p3 p4 "@0,-500")
(Command "dimaligned" p4 p1 "@-500,-500")
(Command "dimaligned" p1 p3 "@100,100")
)
)
(close ff)
)
) |
|