xjm200419042 发表于 2008-5-22 12:23:00

画横断面的问题

<p><font size="6">各位大哥帮帮小弟!</font></p><p><font size="7">请告知用excel和autocad绘制道路横断面图的方法!</font></p>

大菜鸟 发表于 2008-5-28 16:11:00

hnsy_2008 发表于 2008-5-28 23:23:00

刚申请的 请大家以后多多照顾哈

cjf160204 发表于 2024-6-26 14:03:11

hnsy_2008 发表于 2008-5-28 23:23
刚申请的 请大家以后多多照顾哈

(defun c:DrawSectionFromExcelData ()
; 读取导入的 Excel 数据
(defun read-excel-data (filename)
    (setq file (open filename "r"))
    (setq data nil)
    (while (setq line (read-line file))
      (setq values (vl-string->list line))
      (setq data (append data (list values)))
    )
    (close file)
    data
)

; 根据数据绘制横断面图
(defun draw-sections (data)
    (setq start-point (getpoint "\n请输入绘图起始点: "))
    (foreach row data
      (setq mileage (atof (nth 0 row)))
      (setq offset (atof (nth 1 row)))
      (setq elevation (atof (nth 2 row)))
      (draw-one-section start-point offset elevation)
    )
)

; 绘制单个横断面线段
(defun draw-one-section (start-point offset elevation)
    (setq end-point (polar start-point 0 offset))
    (setq end-point (list (car end-point) (+ (cadr start-point) elevation)))
    (command "pline" start-point end-point)
)

; 让用户选择 Excel 数据文件
(setq filename (getfiled "选择 Excel 数据文件" "" "csv" 1))
(if (findfile filename)
    (progn
      (setq data (read-excel-data filename))
      (draw-sections data)
    )
    (princ "\n未找到指定的文件。")
)
)

yanshengjiang 发表于 2024-7-17 17:57:59

hnsy_2008 发表于 2008-5-28 23:23
刚申请的 请大家以后多多照顾哈

注册 登录一次就在没来过了啊真遗憾

f4800 发表于 2024-8-4 23:17:02

注册时间2008-5-22


元老级人物啊

008698 发表于 2024-8-20 11:12:53

你还别说,CAD画横断面图,的方面,我也很想知道。简单方便的。
页: [1]
查看完整版本: 画横断面的问题