批量插入参照
(defun function_INSERT_XREF ()(setq filename (getfiled "选择一个文件" "*" "dwg" 16))
(setq path (strcat (vl-filename-directory filename) "\\"))
(setq list_filenames (vl-directory-files path "*.dwg" 1))
(setq i 0)
(setq p1 nil)
(setq n (length list_filenames))
(setq `distance (getreal "\n输入插入间距:"))
(repeat n
(command "-xref" "a" (strcat path (nth i list_filenames)) (if (not p1) (setq p1 '(0 0 0)) (setq p1 (polar p1 (/ pi 2) (* 1 `distance)))) 1 1 0)
(princ (strcat "插入参照 " (nth i list_filenames) "\r"))
(setq i (+ i 1))
)
(command "zoom" "e" "zoom" "0.8x")
)
感谢 dshshi 分享程序! 请问下 这个命令怎能设置? 如果增加个全选或部分选功能更完美,文件夹里的参照可能会分不同楼层的,全参照进来还要拆分。 可以结合http://bbs.mjtd.com/thread-190849-1-1.html实现多选DWG
页:
[1]