12
25
13
初露锋芒
;;;---------------------------------------- setvar --------------------------(defun saveVars() (setq blkList (list)) (setq ignlist (get_tile "bloqlist")) (setq count 1) (while (setq fila (read ignlist)) (setq blkList (append blkList (list (nth fila bloList)))) (while (and (/= " " (substr ignlist count 1)) (/= "" (substr ignlist count 1))) (setq count (1+ count))) (setq ignlist (substr ignlist count))));;;---------------------------------------- read file "1-DWG-TOMACORRIENTES.txt" for default --------------------------(defun blokinf ()(setq bloList (list)) (if (findfile "1-DWG-TOMACORRIENTES.txt") (progn(if (setq ruta (open (findfile "C:/Program Files/AutoCAD 2008/1-DWG-TOMACORRIENTES.txt") "r"))(progn (read-line ruta) (while (setq pa (read-line ruta)) (setq bloList (append bloList(list (list pa)))))(close ruta))))) bloList );;;---------------------------------------- main program --------------------------(defun c:E1 ( / bloqlist$ infolist$)(if (not *E1@) (setq *E1@ (list nill "" "")))(setq bloqlist$ (nth 1 *E1@))(setq infolist$ (nth 2 *E1@))(setvar "cmdecho" 0)(setq bloList (blokinf)) (if bloList (progn(setq dcl_id (load_dialog "INSERT-1.dcl")) (if (not (new_dialog "INSERTA" dcl_id "" (cond (*screenpointE1*) ('(-1 -1))))) (progn(princ "\n**ERROR**") (exit))) (setq bloNames (list)) (foreach pa bloList(setq bloNames (append bloNames(list (car pa)))))(setq folder (GetDwgsMob "AutoCAD 2008")) ;;add version autocad to folder;;;;(_addlist "bloqlist" bloNames)(_addlist "infolist" folder)(set_tile "bloqlist" bloqlist$)(set_tile "infolist" infolist$)(action_tile "bloqlist" "(setq bloqlist$ $value)")(action_tile "infolist" "(start_list "bloqlist") (mapcar 'add_list (eval (read (strcat "1-DWG-" $value ".TXT")))) (end_list)")(action_tile "cancel" "(setq *screenpointE1* (done_dialog 1))")(action_tile "accept" "(saveVars)(setq *screenpointE1* (done_dialog 2))")(setq ddiag (start_dialog))(unload_dialog dcl_id)(setq *E1@ (list nil bloqlist$ infolist$))(if (= ddiag 1) (prompt "\n**Cancel**")) (princ))));;----------------- Path-2DAMobBasico ------------------------------------;; main route ---> "C:/Program Files/";;------------------------------------------------------------------------(defun Path-2DAMobBasico () "C:/Program Files/");;------------------------ GetDwgsMob ------------------------------------------------------------------;; collects data from the specified directory (setq folder (GetDwgsMob "AutoCAD 2008"));; return ---> "C:/Program Files/AutoCAD 2008/";;------------------------------------------------------------------------------------------------------(defun GetDwgsMob (sParentMob / ListaMob DirMobTipo) (if (setq DirMobTipo (strcat (Path-2DAMobBasico) sParentMob)) (setq ListaMob (vl-directory-files (strcat DirMobTipo "\") "*.txt" 1) ListaMob (mapcar (function vl-filename-base) ListaMob)) );c.if ListaMob );c.defun (defun _addlist ( key lst ) (start_list key) (foreach x lst (add_list x)) (end_list) lst)
INSERTA : dialog { label = "Program....."; initial_focus="bloqlist"; : column { spacer_1; : boxed_row { label = "content of each list"; alignment = centered; spacer_1; : list_box { key = "bloqlist"; allow_accept = true; fixed_width = true; width = 40; value = "0";} } spacer_1; } spacer_1; : popup_list { width =40; key = "infolist"; value = "1"; is_enabled = true ; } spacer_1; : row { : button { key = "accept";label = "accept"; is_default = true;width =14;} : button { key = "cancel";label = "cancel"; is_default = false; is_cancel = true;width =14;} }}
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页
微信公众平台
扫描访问手机版
点击图片下载手机App
|关于我们|小黑屋|乐筑天下 繁体中文
GMT+8, 2025-3-13 00:57 , Processed in 0.372209 second(s), 54 queries .
© 2020-2025 乐筑天下
在线时间:10:00-17:00
暂无
扫一扫,关注我们
帮助中心
关于我们
下载APP客户端