lisp 参数类型错误 munberp: nil
(defunC:mx(/p0tsmaxslhltsts1sp0sp2hp1hp2wp1wp2xxpxtxp1xp2st);;;;sl竖线长度ts图样数量sz竖线X轴坐标值...
(defun C:mx(/ p0 tsmax sl hl ts ts1 sp0 sp2 hp1 hp2 wp1 wp2 xxp xt xp1 xp2 st)
;;;;sl竖线长度 ts图样数量 sz竖线X轴坐标值
(setvar "cmdecho" 0);防止执行命令过程显示
(prin1)
(setq ts 0)
(setq ts1 0)
(setq hl 0)
(setq xxp 0)
(setq sl(* 7.5 (+ tsmax 1))) ;计算竖线长度
(setq p0(getpoint "选取插入点:"))
(setq tsmax(getint "输入零件数量:")) ;图样数量值赋予tsmax变量
;以下画边框线
(setq sp0(list 190 sl))
(command "rectang" "0,0" sp0)
;以下画列分割线
(setq sp2(list 25 sl))
(command "line" "25,0" sp2 "")
(setq sp2(list 50 sl))
(command "line" "50,0" sp2 "")
(setq sp2(list 90 sl))
(command "line" "90,0" sp2 "")
(setq sp2(list 140 sl))
(command "line" "140,0" sp2 "")
(setq sp2(list 165 sl))
(command "line" "165,0" sp2 "")
;以下画行分割线
(while (< ts tsmax)
(setq ts(+ 1 ts))
(setq hl(+ 7.5 hl))
(setq hp1(list 0 hl))
(setq hp2(list 190 hl))
(command "line" hp1 hp2 "")
)
;以下表头文字
(setq wp1(list 0 (* 7.5 tsmax)))
(setq wp2(list 25 sl))
(command "mtext" wp1 "j" "mc" wp2 "序号" "")
(setq wp1(list 25 (* 7.5 tsmax)))
(setq wp2(list 50 sl))
(command "mtext" wp1 "j" "mc" wp2 "图样名称" "")
(setq wp1(list 50 (* 7.5 tsmax)))
(setq wp2(list 90 sl))
(command "mtext" wp1 "j" "mc" wp2 "图样编码" "")
(setq wp1(list 90 (* 7.5 tsmax)))
(setq wp2(list 140 sl))
(command "mtext" wp1 "j" "mc" wp2 "说明" "")
(setq wp1(list 140 (* 7.5 tsmax)))
(setq wp2(list 165 sl))
(command "mtext" wp1 "j" "mc" wp2 "数量" "")
(setq wp1(list 165 (* 7.5 tsmax)))
(setq wp2(list 190 sl))
(command "mtext" wp1 "j" "mc" wp2 "位置" "")
;以下序号文字
(while (< ts1 tsmax)
(setq st(- tsmax ts1))
(setq xp1(list 0 xxp))
(setq xp2(list 25 (+ xxp 7.5)))
(command "mtext" xp1 "j" "mc" xp2 st "")
(setq xxp(+ xxp 7.5))
(setq ts1(+ 1 ts1))
)) 展开
;;;;sl竖线长度 ts图样数量 sz竖线X轴坐标值
(setvar "cmdecho" 0);防止执行命令过程显示
(prin1)
(setq ts 0)
(setq ts1 0)
(setq hl 0)
(setq xxp 0)
(setq sl(* 7.5 (+ tsmax 1))) ;计算竖线长度
(setq p0(getpoint "选取插入点:"))
(setq tsmax(getint "输入零件数量:")) ;图样数量值赋予tsmax变量
;以下画边框线
(setq sp0(list 190 sl))
(command "rectang" "0,0" sp0)
;以下画列分割线
(setq sp2(list 25 sl))
(command "line" "25,0" sp2 "")
(setq sp2(list 50 sl))
(command "line" "50,0" sp2 "")
(setq sp2(list 90 sl))
(command "line" "90,0" sp2 "")
(setq sp2(list 140 sl))
(command "line" "140,0" sp2 "")
(setq sp2(list 165 sl))
(command "line" "165,0" sp2 "")
;以下画行分割线
(while (< ts tsmax)
(setq ts(+ 1 ts))
(setq hl(+ 7.5 hl))
(setq hp1(list 0 hl))
(setq hp2(list 190 hl))
(command "line" hp1 hp2 "")
)
;以下表头文字
(setq wp1(list 0 (* 7.5 tsmax)))
(setq wp2(list 25 sl))
(command "mtext" wp1 "j" "mc" wp2 "序号" "")
(setq wp1(list 25 (* 7.5 tsmax)))
(setq wp2(list 50 sl))
(command "mtext" wp1 "j" "mc" wp2 "图样名称" "")
(setq wp1(list 50 (* 7.5 tsmax)))
(setq wp2(list 90 sl))
(command "mtext" wp1 "j" "mc" wp2 "图样编码" "")
(setq wp1(list 90 (* 7.5 tsmax)))
(setq wp2(list 140 sl))
(command "mtext" wp1 "j" "mc" wp2 "说明" "")
(setq wp1(list 140 (* 7.5 tsmax)))
(setq wp2(list 165 sl))
(command "mtext" wp1 "j" "mc" wp2 "数量" "")
(setq wp1(list 165 (* 7.5 tsmax)))
(setq wp2(list 190 sl))
(command "mtext" wp1 "j" "mc" wp2 "位置" "")
;以下序号文字
(while (< ts1 tsmax)
(setq st(- tsmax ts1))
(setq xp1(list 0 xxp))
(setq xp2(list 25 (+ xxp 7.5)))
(command "mtext" xp1 "j" "mc" xp2 st "")
(setq xxp(+ xxp 7.5))
(setq ts1(+ 1 ts1))
)) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询