这不是一项容易的任务,它非常可行。你有不同的方法来实现最终结果,最简单的方法是不直接连接到excel,而是编写一个csv文件。
建议修改这个程序,它读取文本列并将其导出,您必须将其更改为水平而不是垂直。
自动完成100个横截面的大任务,使其保持正确的顺序。
我们使用ARD,它有一个横截面列表选项,所以在word中做了一些工作,一切都完成了。我记不起civ3d中是否有相同的功能,需要查看功能区中的“报告”选项,它有许多导出例程。工具空间工具箱报告
- ; converts column of text to comma seprated file with text value and y value
- ; put in excell and sort by y value
- ; by Alan H Nov 2004
- (setq x 1)
- (while (/= x 4)
- (setq howmany (rtos x 2 0))
- (setq fileto (strcat "c:/temp/setout" howmany))
- (princ fileto)
- (setq fout (open fileto "w"))
- (while (not (setq ss (ssget ))))
- (princ "wow")
- (while (setq en (ssname ss 0))
- ; Entity type
- (setq entyp (cdr (assoc 0 (entget en))))
- (princ "wow")
- (if (= entyp "TEXT")
- (progn
- (setq xyz (cdr (assoc 10 (entget en))))
- (setq txtht (cdr (assoc 1 (entget en))))
- ;write file out here
- (setq textout (strcat txtht "," (rtos (cadr xyz) 2 3)))
- ;write
- (write-line textout fout)
- (princ textout)
- )
- )
- ; Delete each measured entity from set
- (ssdel en ss)
- ;end while
- )
- (close fout)
- (setq x (+ x 1))
- ) ;end if loop 3 times
- (princ)
|