只需一步,快速开始
使用道具 举报
不考虑实数的精度
(read (vl-string-translate "( )" "\",\"" (vl-princ-to-string '(0.2 -0.02 2.35 -0.025))))
(defun lindataout (filediretory) ;;(setvar "cmdecho" 0);;没有用到command可以忽略 (if (= filediretory t) (setq filediretory (getvar "dwgprefix")) filediretory) (setq nm (open (strcat filediretory "线型文件.lin") "w")) (princ " " nm) (close nm) ;;(vl-load-com)没有用到ActiveX可以忽略 (command "purge" "all" "*" "N") (command "purge" "all" "*" "N") (if (= filediretory t) (setq filediretory (getvar "dwgprefix")) filediretory) (setq nm (open (strcat filediretory "线型文件.lin") "a")) (princ "\n" nm) (princ "; Linetypes exported by LinOut.lsp Version 2.0" nm) (princ "\n;" nm) (princ "\n; by Koyote - 方中集团--工程管理部:李敏" nm) (princ "\n;" nm) (princ "\n" nm) ;;蓝色部分可缩写为 (princ "\n; Linetypes exported by LinOut.lsp Version 2.0\n; \n; by Koyote - 方中集团--工程管理部:李敏\n;\n" nm) (setq txtsty nil txtlst (list)) (setq txtsty (tblnext "LTYPE" t)) (setq txtsty (tblnext "LTYPE"));;紫色部分只有最后一个有效啊 (setq name (cdr(assoc 2 txtsty))) (setq name1 nil)(while (/= name name1) (setq name (cdr(assoc 2 txtsty)))(if (/= name "CONTINUOUS") (progn (setq ts (cdr(assoc 3 txtsty))) (setq ltdata (entget (tblobjname "ltype" name))) (setq ltlst (mapcar (function(lambda(x) (cDr x))) (vl-remove-if-not '(lambda(x) (= 49 (car x))) ltdata))) (setq ltlst (read (vl-string-translate "( )" "\",\"" (vl-princ-to-string ltlst)))) (princ "*" nm) (princ name nm) (princ "," nm) (princ ts nm) (princ "\nA," nm) (princ ltlst nm) (princ "\n" nm) (setq txtsty (tblnext "LTYPE")) (if(/= txtsty nil) (setq name1 (cdr(assoc 2 txtsty))) );End_if );End_progn);End_if );End_while(close nm) (setvar "cmdecho" 1)(princ))
;;蓝色部分可缩写为
(princ "\n; Linetypes exported by LinOut.lsp Version 2.0\n; \n; by Koyote - 方中集团--工程管理部:李敏\n;\n" nm)
(setq txtsty nil txtlst (list)) (setq txtsty (tblnext "LTYPE" t)) (setq txtsty (tblnext "LTYPE"));;紫色部分只有最后一个有效啊 (setq name (cdr(assoc 2 txtsty))) (setq name1 nil)(while (/= name name1) (setq name (cdr(assoc 2 txtsty)))(if (/= name "CONTINUOUS") (progn (setq ts (cdr(assoc 3 txtsty))) (setq ltdata (entget (tblobjname "ltype" name))) (setq ltlst (mapcar (function(lambda(x) (cDr x))) (vl-remove-if-not '(lambda(x) (= 49 (car x))) ltdata))) (setq ltlst (read (vl-string-translate "( )" "\",\"" (vl-princ-to-string ltlst)))) (princ "*" nm) (princ name nm) (princ "," nm) (princ ts nm) (princ "\nA," nm) (princ ltlst nm) (princ "\n" nm) (setq txtsty (tblnext "LTYPE")) (if(/= txtsty nil) (setq name1 (cdr(assoc 2 txtsty))) );End_if );End_progn);End_if );End_while(close nm) (setvar "cmdecho" 1)(princ))
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 ) ©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途
GMT+8, 2024-5-21 03:38 , Processed in 0.335712 second(s), 26 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.