加载程序提示数类型错误: numberp: nil怎么解决啊
在论坛找了两个程序合在一起使用可以解决我画图的一些问题,但是合在一起后用不了,老是提示错误,不知道怎么解决,下面是我合并后的程序(DEFUN C:jz (/ co_old pt_old nn oo ss st_pt end_pt pt1 pt2 pt_tmp l_ss)
(vl-load-com)
(SETQ co_old (GETVAR 'cmdecho))
(SETQ pt_old (GETVAR 'PEDITACCEPT))
(SETVAR 'cmdecho 0)
(SETVAR 'PEDITACCEPT 1)
(OR (SETQ nn (SSGET "I" '((0 . "*LINE,ARC"))))
(SETQ nn (SSGET '((0 . "*LINE,ARC"))))
)
(SSSETFIRST nil)
(IF nn
(PROGN
(IF (= (SSLENGTH nn) 1) (SETQ nn (SSGET "A" '((0 . "*LINE,ARC")))) ) ;_ 结束IF
(COMMAND "pedit" "m" nn "" "j" 0 "")
)
(PRINC "\n***未选择对象***")
)
(setq oo (entsel "请选择线"))
(setq ss (car oo))
(setq st_pt (vlax-curve-getStartPoint ss)
end_pt (vlax-curve-getEndPoint ss)
pt1 (getpoint "线上第一个点")
pt2 (getpoint "线上第二个点")
)
(if (>(vlax-curve-getParamAtPoint ss pt1) (vlax-curve-getParamAtPoint ss pt2))
(setq pt_tmp pt2 pt2 pt1
pt1 pt_tmp)
)
(command "undo" "be")
(command "_break" ss st_pt pt1)
(command "_break" ss end_pt pt2)
(command ".copy" ss "" '(0 0) '(0 0))
(setq l_ss (entget (entlast)))
(command "undo" "end")
(command "undo" "")
(entmake l_ss)
(setq ss (entlast))
(vla-put-Color (vlax-ename->vla-object ss) 1)
(SETVAR'cmdecho co_old)
(SETVAR'PEDITACCEPT pt_old)
(PRIN1)
)
我这边正常运行,没看出啥问题 帝都划水王 发表于 2023-5-26 10:57
我这边正常运行,没看出啥问题
我编辑器里加载没问题,但是直接导入就是有问题,不知道怎么回事 文件编码不对 另存为ANSI编码的再处理一下问号乱码
飞雪神光 发表于 2023-5-26 16:09
文件编码不对 另存为ANSI编码的再处理一下问号乱码
大神真厉害,确实是这个问题,感谢
页:
[1]