找回密码
 注册会员
查看: 3751|回复: 8

[求助] 2011 如何调用2002的lisp

[复制链接]
发表于 2010-8-24 13:20:37 |Error| 显示全部楼层 |阅读模式

我们不再是孤独的探索者;让我们的手紧紧相连,一起成长。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
我们实验室里的师兄在若干年前用编写了一个用于r14的lisp程序,现在cad都已经更新到2011了,但是发现无法加载原来的程序,在实验室里只有2002可以调用,但是在win7 64bit上无法安装2002。所以在此求救,那位牛人可以帮忙解答一下,在2011里如何加载2002的lisp程序,或者如果想要加载2002的程序,如何改源程序才能让2011的cad也可以加载老款cad的程序,跪谢!!!!!!!
头像被屏蔽
发表于 2010-8-24 19:30:56 |Error| 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 顶 踩

使用道具 举报

 楼主| 发表于 2010-8-27 22:13:35 |Error| 显示全部楼层
这哪儿是志气的问题啊,实验室的老师在催我啊!!!!师兄已然出国好几年了,根本联系不上了!!!我只是想在我这里解决这个问题!!!!
回复 顶 踩

使用道具 举报

 楼主| 发表于 2010-8-27 22:36:13 |Error| 显示全部楼层
回复 2# 红色32


    不是长不长志气的问题,是实验室始终在用这个程序,老师交给的任务,不得不去完成啊,如果能帮忙还是尽量帮一下吧,师兄,我都没见过,不知道在哪个国家混呢!!!
回复 顶 踩

使用道具 举报

 楼主| 发表于 2010-8-29 12:53:52 |Error| 显示全部楼层
现在的问题是不能运行程序,可以加载了,加载后输入r,提示问题是->错误:参数类型错误:FILE nil,这是怎么回事儿啊,我好久都没有用过CAD了,已经是个新手了!!!摆脱各位高手帮忙解决一下!!!!
回复 顶 踩

使用道具 举报

发表于 2010-8-29 19:52:59 |Error| 显示全部楼层
你为何不把程序发上来呀,叫大家看看
回复 顶 踩

使用道具 举报

 楼主| 发表于 2010-8-30 09:25:02 |Error| 显示全部楼层
;******************
;进 风 口  图   纸
;编   程  :黄东涛
;单 位 : 声学实验室
;******************


(defun c:r()
;******************
;读  数 据  文  件
;******************
(setq f (open "inlet.dat" "r"))
(setq ff (read(read-line f)))
(setq sca (read(read-line f)))
(setq plinew (read(read-line f)))

(setq DP0 (read(read-line f)))
(setq DP1 (read(read-line f)))
(setq DP2 (read(read-line f)))
(setq Rz0 (read(read-line f)))
(setq Rc0 (read(read-line f)))
(setq Rci (read(read-line f)))
(setq b2 (read(read-line f)))
(setq LL (read(read-line f)))
(setq sita (read(read-line f)))
(setq bb (read(read-line f)))
(setq houdu (read(read-line f)))
(setq fthoudu (read(read-line f)))
(setq Dmax (read(read-line f)))
(setq Dluoshikong (read(read-line f)))
(setq lskbj (read(read-line f)))

(setq sealpd (read(read-line f)))

(close f)


;*****************


(initget 1)
  (cond
    ((= ff 0) (setq l 2000 b 1500))
    ((= ff 1) (setq l 780 b 550))
    ((= ff 2) (setq l 550 b 385))
    ((= ff 3) (setq l 385 b 280))
    ((= ff 4) (setq l 180 b 280))
)
;(setvar "cmdecho" 0)
;(setvar "blipmode" 0)
;(setvar "luprec" 2)
;(setvar "ltscale" 5)
;(setvar "limmax" (list l b))
(command "zoom" "a")
;(command "units" "" "2" "" "" "" "")
(command "layer" "n" "1" "c" 7 "1"
                 "n" "2" "c" 2 "2"
                 "n" "3" "c" 1 "3" "l" "dashed" "3"
                 "n" "4" "c" 1 "4" "l" "center" "4"
                 "n" "5" "c" 1 "5" "l" "phantom" "5"
                 "n" "6" "c" 3 "6"
                 "n" "7" "c" 4 "7"
                 "n" "8" "c" 5 "8"
                 "s" 7 ""
)


(setq pt1 '(0.2 0.2)
      pt2 (list (- l 0.2) 0.2)
      pt3 (list (- l 0.2) (- b 0.2))
      pt4 (list 0.2 (- b 0.2))
)
;(command "pline" pt1 "w" 0.4 0.4 pt2 pt3 pt4 "c")
(command "layer" "s" 1 "")
(foreach z'(pt1 pt2 pt3 pt4 b l f) (set z nil))
;**********
;*画 图 纸*
;**********
(setq
;**************************      
      p00 '(1500 1000)
          pw (polar p00 pi 1400)
      pi05 (* pi 0.5)
      pi15 (* pi 1.5)
          sita1 (* sita pi)
          sita (/ sita1 180)
                 sin-sita (sin sita)
                 cos-sita (cos sita)

          plsk (polar p00 pi05 (* 0.5  Dluoshikong))
          plsks (polar p00 pi15 (* 0.5  Dluoshikong))

      p0 (polar p00 pi (+  houdu  bb))

          c (polar p00 pi05 (* 0.5  DP1) )
          cs (polar p00 pi15 (* 0.5  DP1) )
  
          d (polar p00 pi05 (* 0.5  Dmax) )
          ds (polar p00 pi15 (* 0.5  Dmax) )

          d1 (polar d pi  houdu )

      g (polar p0 pi05 (* 0.5  DP1) )
      gs (polar p0 pi15 (* 0.5  DP1) )

      h (polar p0 pi05  rz0)
      f (polar p0 pi05 (+ (* 0.5  dp0)   rci))
          e (polar h 0  b2)
                  ese (polar e (+ sita pi15)   rc0 )
                  ese1 (polar ese (+ sita pi05)  fthoudu )

                  d-ese-c (-   ll (+  b2 ( *  rc0 sin-sita)))
                  cc (polar ese sita (/ d-ese-c cos-sita))  
                  cc1 (polar cc pi05 fthoudu)  
                  cc0 (list (car cc) (cadr p00))  
                  esee (list (car cc0) (cadr ese))  

          a (polar f 0  b2)
          b (polar e pi15  rc0)
                 dis1 (- rz0 (* 0.5 dp1))
                 dis2 (- rc0 fthoudu)
                 disw (- (* dis2 dis2 ) (* dis1 dis1))
                 dis4 (sqrt disw)
                 ew1 (polar e pi15 dis1)
                 g1 (polar ew1 pi dis4)
;      g1 (polar e pi (-  rc0 fthoudu))
;      gw (polar g 0 (* 5  fthoudu))

           b1 (polar b pi05 fthoudu)
           cw (polar p00 pi  houdu)
           c1 (polar a 0 (-  rci  houdu))

          pwcn (list (car pw) ( cadr c))
          pwcs (list (car pw) ( cadr cs))
          pwdn (list (car pw) ( cadr d))
          pwds (list (car pw) ( cadr ds))

          rp2 (* 0.5 dp2)
          pwdp2n (polar pw pi05 rp2)
          pwdp2s (polar pw pi15 rp2)
          pwdp2hn (polar pw pi05 (+ fthoudu rp2))
          pwdp2hs (polar pw pi15 (+ fthoudu rp2))

          pwcs (list (car pw) ( cadr cs))
          pwdn (list (car pw) ( cadr d))
          pwds (list (car pw) ( cadr ds))

          pwkn (list (car pw) ( cadr plsk))
          pwks (list (car pw) ( cadr plsks))
            temp1 ( - (cadr b) ( cadr p0) )
          pwbn (polar pw pi05 temp1)
          pwbs (polar pw pi15 temp1)
          plsk11(polar pwkn pi05 lskbj)
          plsk22(polar pwkn pi15 lskbj)

)
(command "layer" "s" 1 "")
(command "arc"  g "c" e ese)
(command "pedit" "l" "y" "w" plinew "x")
(command "arc"  g1 "c" e ese1)
(command "pedit" "l" "y" "w" plinew "x")

(command "pline" p00 "w" plinew plinew c d "")
(command "pline" d "w" plinew plinew d1 "")
(command "pline" d1 "w" plinew plinew cw "")
(command "pline" g1 "w" plinew plinew g p0  "")
(command "pline" ese "w" plinew plinew  cc  "")
(command "pline" ese1 "w" plinew plinew  cc1  "")
(command "pline" cc1 "w" plinew plinew  cc0  "")
(command "layer" "s" 6 "")
(command "line" ese esee  "")
(command "line" ese e  "")

(command "layer" "s" 1 "")

;(command "arc"  pwcn "c" pw pwcs)
;(command "pedit" "l" "y" "w" plinew "x")
;(command "arc"  pwcs "c" pw pwcn)
;(command "pedit" "l" "y" "w" plinew "x")
(command "arc"  pwbn "c" pw pwbs)
(command "pedit" "l" "y" "w" plinew "x")
(command "arc"  pwbs "c" pw pwbn)
(command "pedit" "l" "y" "w" plinew "x")
(command "arc"  pwdn "c" pw pwds)
(command "pedit" "l" "y" "w" plinew "x")
(command "arc"  pwds "c" pw pwdn)
(command "pedit" "l" "y" "w" plinew "x")

(command "arc"  pwdp2n "c" pw pwdp2s)
(command "pedit" "l" "y" "w" plinew "x")
(command "arc"  pwdp2s "c" pw pwdp2n)
(command "pedit" "l" "y" "w" plinew "x")

(command "arc"  pwdp2hn "c" pw pwdp2hs)
(command "pedit" "l" "y" "w" plinew "x")
(command "arc"  pwdp2hs "c" pw pwdp2hn)
(command "pedit" "l" "y" "w" plinew "x")

(command "arc"  plsk11 "c" pwkn plsk22)
(command "pedit" "l" "y" "w" plinew "x")
(command "array" "l" "" "p" pw 8 "" "")

(command "arc"  plsk22 "c" pwkn plsk11)
(command "pedit" "l" "y" "w" plinew "x")
(command "array" "l" "" "p" pw 8 "" "")



(command "layer" "s" 4 "")
(command "arc"  pwkn "c" pw pwks)
(command "pedit" "l" "y" "w" 0.6 "x")
(command "arc"  pwks "c" pw pwkn)
(command "pedit" "l" "y" "w" 0.6 "x")

(command "layer" "s" 4 "")
(command "pline" (polar p0 pi 20) "w" 0.6 0.6 (polar cc0 0 20) "")
(command "pline" (polar plsk pi 12) "w" 0.6 0.6 (polar plsk 0 10) "")
(command "pline" (polar pw pi 500) "w" 0.6 0.6 (polar pw 0 500) "")
(command "pline" (polar pw pi05 500) "w" 0.6 0.6 (polar pw pi15 500) "")



(command "layer" "s" 1 "")

(princ)
)
回复 顶 踩

使用道具 举报

发表于 2010-10-17 16:42:54 |Error| 显示全部楼层
在cad中,一般没有版本的区别。不过,从你叙述的反映来说,是文件的代码是空的(FILE nil)。那么你检查一下,文件‘inlet.dat'是不是存在而且在cad的搜索路径上。也就是说,你的这个程序还应有一个数据文件来支持它运行。本文中的绘制数据,都是取自于它。                    qhd.qsj@163.com
回复 顶 踩

使用道具 举报

发表于 2010-10-19 10:31:37 |Error| 显示全部楼层
lisp程序与autoCAD版本无关
回复 顶 踩

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

小黑屋|手机版|Cncad.Net ( 苏ICP备2026083443号 )

GMT+8, 2026-11-1 19:40 , Processed in 0.225159 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表