步入大三的陶爷 发表于 2012-10-21 18:24:09

求助啊 错误: 参数类型错误: numberp: nil 求各位大神帮个忙

;;;
;;;   zclhz.lsp   
;;;
;;;   
;;;            
;;;
(defun c:zclhz();定义命令
(setq dcl_id(load_dialog "zcl.dcl"));加载窗体
(if (< dcl_id 0)
    (exit)
    )
(if (not (new_dialog "zcl" dcl_id)) (exit))
(image1 "zcl_image" "zclsl");定义图形函数
(action_tile "accept" "(data_set)")
(start_dialog)
(unload_dialog dcl_id)
(draw_zcl);执行绘图程序
)
(defun image1(key image_name / x x);加载图形
(start_image key)
(setq x (dimx_tile key)
      y (dimy_tile key)
      )
(fill_image 0 0 x y 250)
(slide_image 0 0 x y image_name)
(end_image)
)

(defun data_set();数据从窗体传入和处理
(setq da ( atof (get_tile "da")))
(setq df ( atof (get_tile "df")))
(setq d ( atof (get_tile "d")))
(setq m ( atof (get_tile "m")))
(setq dc ( atof (get_tile "dc")))
(setq w ( atof (get_tile "w")))
(setq t ( atof (get_tile "t")))

(setq b1 ( list (+ 100 (/ dc 2)) (+ 100 (* 2 (/ dc 5)) (* -2 m) (/ df 4))))
(setq b2 ( list (+ 100 (* 3 (/ dc 4))) (+ 100 (* 2 (/ dc 5)) (* -2 m) (/ df 4))))
(setq b3 ( list (+ 100 dc) (+ 100 (* 2 (/ dc 5)) (* -2 m) (/ df 4))))
(setq b4 ( list 100 (- 100 (* 4 (/ dc 5)))))
(setq b5 ( list 40 100))
(setq b6 ( list 220 100))
(setq b7 ( list 240 100))
(setq b8 ( list 260 100))
(setq b9 ( list (+ 99 (* 3 (/ dc 2))) (- 100 (/ da 2))))
(setq b10 ( list (+ 100 (* 3 (/ dc 2))) (- 101 (/ da 2))))
(setq b11 ( list (+ 100 (* 3 (/ dc 2))) (- 100 (/ df 2) (* -4 m))))
(setq b12 ( list 700 (+ 100 (/ dc 2) t 20)))
;//****************************************
;//******定义关键点为作图用****************
(setq p1 ( list 100 100))
(setq p2 ( list 100 (+ 101 (/ dc 2))))
(setq p3 ( list 100 (+ 100 (/ dc 2) t)))
(setq p4 ( list 100 (+ 100 (* 4 (/ dc 5)))))
(setq p5 ( list 100 (+ 100 (/ dc 2) (* -4 m))))
(setq p6 ( list 100 (+ 100 (+ dc 2))))
(setq p7 ( list 100 (+ 99 (/ dc 2))))
(setq p8 ( list 101 (+ 100 (/ dc 2))))
(setq p9 ( list (+ 99 (* 3 (/ dc 2))) (+ 100 (/ da 2))))
(setq p10 ( list (+ 100 (* 3 (/ dc 2))) (+ 99 (/ da 2))))
(setq p11 ( list (+ 100 (* 3 (/ dc 2))) (+ 100 (/ df 2))))
(setq p12 ( list (+ 100 (* 3 (/ dc 2))) (+ 100 (/ df 2) (* -4 m))))
(setq p13 ( list (+ 100 (* 3 (/ dc 2))) (+ 100 (* 4 (/ dc 5)))))
(setq p14 ( list (+ 100 (* 3 (/ dc 2))) (+ 100 t (/ dc 2))))
(setq p15 ( list (+ 100 (* 3 (/ dc 2))) (+ 101 (/ dc 2))))
(setq p16 ( list (+ 100 (* 3 (/ dc 2))) 100))
(setq p17 ( list 101 100))
(setq p18 ( list 101 (+ 100 (/ dc 2))))
(setq p19 ( list (+ 99 (* 3 (/ dc 2))) (+ 100 (/ dc 2))))
(setq p20 ( list (+ 99 (* 3 (/ dc 2))) 100))
(setq p21 ( list (+ 92 (/ dc 2)) (+ 100 (* 4 (/ dc 5)))))
(setq p22 ( list (+ 100 (/ dc 2)) (+ 108 (* 4 (/ dc 5)))))
(setq p23 ( list (+ 100 dc) (+ 108 (* 4 (/ dc 5)))))
(setq p24 ( list (+ 108 dc) (+ 100 (* 4 (/ dc 5)))))
(setq p25 ( list (+ 100 (/ dc 2)) (+ 100 (/ df 8) -m (* 3 (/ df 5)))))
(setq p26 ( list (+ 100 dc) (+ 100 (/ df 8) -m (* 3 (/ df 5)))))
(setq p27 ( list (+ 100 dc) (+ 100 (* 3 (/ df 8)) (* -3 m) (/ dc 5))))
(setq p28 ( list (+ 100 (/ dc 2)) (+ 100 (* 3 (/ df 8)) (* -3 m) (/ dc 5))))
(setq p29 ( list (+ 92 (/ dc 2)) (+ 100 (/ df 2) (* -4 m))))
(setq p30 ( list (+ 100 (/ dc 2)) (+ 92 (/ df 2) (* -4 m))))
(setq p31 ( list (+ 100 dc) (+ 92 (/ df 2) (* -4 m))))
(setq p32 ( list (+ 108 dc) (+ 100 (/ df 2) (* -4 m))))
(setq p33 ( list 100 (+ 100 (/ d 2))))
(setq p34 ( list (+ 100 (* 3 (/ dc 2))) (+ 100 (/ d 2))))
(setq p35 ( list (+ 100 (* 3 (/ dc 4))) (+ 100 (/ da 2))))
(setq p36 ( list (+ 100 (* 3 (/ dc 4))) 100))
(setq p37 ( list 700 100))
(setq p38 ( list (+ 700 (/ w 2)) (+ 80 (/ dc 2))))
(setq p39 ( list (- 700 (/ w 2)) (+ 80 (/ dc 2))))
(setq p40 ( list 700 (+ 100 (/ dc 2))))
(setq p41 ( list 700 (+ 101 (/ dc 2))))
(setq p42 ( list 700 (- 100 (* 2 (/ dc 5)) (* -2 m) (/ df 4))))
(setq p43 ( list (- 700 (* 2 (/ dc 5)) (* -2 m) (/ df 4)) 100))
(setq p44 ( list 700 (+ 100 (* 2 (/ dc 5)) (* -2 m) (/ df 4))))
(setq p45 ( list (+ 700 (* 2 (/ dc 5)) (* -2 m) (/ df 4)) 100))
(setq p46 ( list (- 700 (/ w 2)) (+ 100 (/ dc 2) t)))
(setq p47 ( list (+ 700 (/ w 2)) (+ 100 (/ dc 2) t)))
(setq p48 ( list 700 (- 100 (/ dc 2))))
(setq p49 ( list 400 100))
(setq p50 ( list 1000 100))
(setq p51 ( list 700 400))
(setq p52 ( list 700 -200))
)
;//****************************************

;//**********绘制齿轮程序******************
(defun draw_zcl);
(command "layer" "n" "zxx" "c" "6" "zxx" "lw" "0.18" "zxx" "s" "zxx" "");//新建图层画中心线
(command "layer" "n" "zjg" "c" "1" "zjg" "lw" "0.5" "zjg" "s" "zjg" "");//新建图层主结构线
(command "layer" "n" "xsx" "c" "1" "xsx" "lw" "0.18" "xsx" "s" "xsx" "");//新建图层画细实线
(command "layer" "n" "chicun" "c" "5" "chicun" "lw" "0.18" "chicun" "s" "chicun """);//新建图层尺寸标注
(command "layer" "n" "tc" "c" "7" "tc" "lw" "0.15" "tc" "s" "tc" "");//新建图层填充

(command "layer" "m" "zxx" "")
(command "line" p49 p50 "")
(command "line" p51 p52 "")
(command "circle" p37 (+ (/ df 4) -(* 2 m) (* 2 (/ dc 5))) "")
(command "layer" "m" "zjg" "")
(command "circle" p37 (/ dc 2) "");//中心园
(command "circle" p37 (+ (/ dc 2) 1) "");//倒角园
(command "circle" p42 (+ (/ df 8) -(* 1 m) -(/ dc 5)) "")
(command "circle" p43 (+ (/ df 8) -(* 1 m) -(/ dc 5)) "")
(command "circle" p44 (+ (/ df 8) -(* 1 m) -(/ dc 5)) "")
(command "circle" p45 (+ (/ df 8) -(* 1 m) -(/ dc 5)) "");//四小圆
(command "circle" p37 (/ da 2) "");//齿顶圆
(command "line" p39 p46 p47 p38 "")
(command "layer" "m" "xsx" "")
(command "circle" p37 (/ d 2) "");//分度圆
(command "circle" p37 (/ df 2) "");//齿根圆
)
;//****************************************


http://bbs.mjtd.com/xwb/images/bgimg/icon_logo.png 该贴已经同步到 步入大三的陶爷的微博

微博评论 发表于 2012-10-21 20:39:43

学霸啊

http://bbs.mjtd.com/xwb/images/bgimg/icon_logo.png 来自 Damon-莫 的新浪微博

phoenixdjq 发表于 2012-11-13 14:27:50

这是什么??
你肯定是定义了错误的类型
例如程序中是要选择文字,你选择了线
肯定出现类型错误
numberp应该是数字的问题,例如你要做数字相加,但是你提出来的是字符串,而不是数值,就会出错

剩下的工作,你自己研究吧
页: [1]
查看完整版本: 求助啊 错误: 参数类型错误: numberp: nil 求各位大神帮个忙