cjf160204 发表于 2024-6-27 14:55:21

命令: ; 错误: 输入的列表有缺陷

(vl-acad-defun   (defun C:ZD()         (vl-load-com)         (regapp "SOUTH")         (regapp "NAME")         (regapp "CODE")         (regapp "TIME")         (setq time (list "TIME" (cons 1000 (menucmd "M=$(edtime,$(getvar,date),YYYY-MO-DD-HH:MM:SS)"))))         (setq osmode (getvar "osmode"))         (setvar "osmode" 0)         (vl-cmdf ".undo" "be")         (setq blc (getint "\n 请输入比例尺 1:"))         (setvar 'userr1 blc)         (setq zg (* 0.002 blc))         (setq scale (* 0.001 blc))         (setq ff (open (getfiled "请选择要展点的数据文件" "" "dat" 2) "r"))         (setq decimal-places (getint "\n 请输入高程点小数位数:")) ; 新增:获取小数位数      (while (and (setq zb (read-line ff)) )             (while (and (vl-string-search "," zb) )               (setq zb (vl-string-subst " " "," zb))            )             (setq zb (read (strcat "(" zb ")")))             (setq id (nth 0 zb))             (if (= (length zb) 5)               (progn                     (setq zpt (list (nth 2 zb) (nth 3 zb) (nth 4 zb)))                )                (progn                     (setq zpt (list (nth 1 zb) (nth 2 zb) (nth 3 zb)))                )            )             (setq p2 (polar zpt (* 0.25 pi) (* 1.5 zg)))             (if (not (null zpt)) ; 增加对 zpt 不为空的检查                (progn                  (princ (strcat "ZPT: " (vl-princ-to-string zpt))) ; 调试输出 zpt                  (entmake (list '(0. "POINT") (cons 10 zpt) '(8. "ZDH") (list -3 (list "NAME" (cons 1000 (vl-princ-to-string (nth 0 zb)))) (list "CODE" (cons 1000 (vl-princ-to-string (nth 1 zb)))) time))                     (entmake (list '(0. "TEXT") (cons 1 (vl-princ-to-string id)) (cons 10 p2) '(7. "HZ") '(8. "ZDH") (cons 40 zg) '(41. 0.8)))                     (gxl-cs:gcd zpt (caddr zpt) scale decimal-places (list "NAME" (cons 1000 (vl-princ-to-string (nth 0 zb))) (cons 1000 (vl-princ-to-string (nth 1 zb))))) ; 传递小数位数                )            )      )         (close ff)         (command "undo")         (command "e")         (setvar "osmode" osmode)         (princ "展点完成")         (princ)   ) )(defun gxl-cs:gcd(insp height scale decimal-places name / pt blkdef obj) ; 新增:接收小数位数参数    (setvar "cmdecho" 0)   (command "layer")   (command "m")   (command "GCD")   (command "c")   (command "1")   (command "")   (command "L")   (command "CONTINUOUS")   (command "")   (command "")   (if height         (progn             (princ (strcat "Height before conversion: " (vl-princ-to-string height))) ; 调试输出 height 原始值            (setq height (rtos height decimal-places)) ; 使用输入的小数位数            (princ (strcat "Height after conversion: " (vl-princ-to-string height))) ; 调试输出转换后的 height      )      (progn             (setq height "")      )    )   (regapp "SOUTH")   (if (not (tblobjname "style" "HZ"))         (progn             (command "style")             (command "HZ")             (command "rs.shx,hztxt.shx")             (command 0)             (command 1)             (command 0)             (command "")             (command "")             (command "")      )    )   (if (not (tblobjname "block" "GC200"))         (progn             (setq blkdef (vla-add (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (vlax-3d-point '(0 0 0)) "GC200"))             (setq obj (vla-addpolyline blkdef (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble (cons 0 5)) '(-0.2 0 0 0.2 0 0))))             (vla-setbulge obj 0 1)             (vla-setbulge obj 1 1)             (vla-put-closed obj :vlax-true)             (vla-put-constantwidth obj 0.4)      )    )   (entmake (list '(0. "INSERT") '(100. "AcDbEntity") '(100. "AcDbBlockReference") '(66. 1) (cons 2 "GC200") (cons 10 insp) (cons 41 scale) (cons 42 scale) (cons 43 scale) (list -3 '("SOUTH" (1000. "202101")) name time)))   (entmake (list '(0. "ATTRIB") '(100. "AcDbEntity") '(100. "AcDbText") (cons 10 (setq pt (polar insp 0 (* 1.2 scale)))) (cons 40 (* 2.0 scale)) (cons 50 0) (cons 41 0.8) (cons 51 0) (cons 1 height) (cons 7 "HZ") (cons 72 0) (cons 11 pt) '(100. "AcDbAttribute") (cons 2 "height") (cons 70 0) (cons 74 2)))   (entmake '((0. "SEQEND")))   (princ) )

liuhe 发表于 2024-6-27 15:36:16

又是盗版破解的别人的东西,自己不会改,你还是删帖跑路吧

czb203 发表于 2024-6-27 15:44:40

小心拉黑屋

sniper1111 发表于 2024-6-27 16:11:53

这个大哥是来搞笑的吧。每次一打开眼前都是一亮

你有种再说一遍 发表于 2024-6-27 18:26:05

本帖最后由 你有种再说一遍 于 2024-6-27 18:27 编辑

YYYY是按照周结算年份,所以尽量用小写
https://blog.csdn.net/qq_37358143/article/details/103868657

dcl1214 发表于 2024-6-28 12:09:44

看帖子的标题不用进去就知道又在偷盗别人的代码,生怕别人不知道你这个行为,还拿到论坛来炫耀你的无知,建议版主直接删除这个帖子
页: [1]
查看完整版本: 命令: ; 错误: 输入的列表有缺陷