为什么总出现报错 nil
等分块命令:(Command "DIVIDE" (entsel) "B" (cdr (assoc 2 (entget (car (entsel))))) "Y")
(Command "DIVIDE" pause "B" (cdr (assoc 2 (entget (car (entsel))))) "Y")
在选择物体时,会立即出现: nil ,究竟是为什么,如何避免这个报错?
本帖最后由 gaics 于 2021-9-18 17:06 编辑
(Command "DIVIDE" (entsel) "B" "块名" "Y" )直接给定块名,也是返回nil
(Command "DIVIDE" (entsel) "B" "块名" "Y" 5)
最终返回nil
(Command "DIVIDE" (entsel) "B" "块名" "Y" 5)(princ)
没有提示
建议这么写:
(Command "DIVIDE" (entsel) "B" (cdr (assoc 2 (entget (car (entsel))))) "Y" pause)
或者通过变量传递等分数量
页:
[1]