这是一个错误的程序

(defun c:dp (/ os dist e pt1 pt2 pt3 a)
    (command "cmdecho" 0)   
    (setq lwe (getvar "useril"))
    (if    (= lwe 0)
    (progn
        (initget (+ 2 4))
        (setq lwe (getint "出图比例[1:?]:"))
        (if    (= lwe nil)
        (setq lwe 100)
        )
        (setvar "useril" lwe)
    )
    )
    (setq lwe (/ lwe 2))
    (command "pline" '(0 0) "w" lwe lwe "")
    (setvar "osmode" 695)
    (setq pt (getpoint "\n起点:"))
    (if    (= pt nil)
    (prompt "\空格与或回车结束!")
    )
    (initget (+ 2 4))
    (setq dist (getdist pt "\n宽度<240>:"))
    (if    (= dist nil)
    (setq dist 240)
    )
    (setq dist (/ dist 2.0))
    (if (= pt nil) (prompt "\ndddddddd"))
    (setq po (getpoint pt "\n下一点:"))
    (setq ang (angle pt po))
    (setq pt1 (polar pt (+ ang (/ pi 2)) dist))
    (setq pt2 (polar pt (- ang (/ pi 2)) dist))
    (setq po1 (polar po (+ ang (/ pi 2)) dist))
    (setq po2 (polar po (- ang (/ pi 2)) dist))
    (setvar "osmode" 0)
    (command "pline" pt1 po1 "" "pline" pt2 po2 "")
    (setq e 1)
    (while e
    (setvar "osmode" 695)
    (setq pb (getpoint po "\n下一点:"))
    (if (= pb nil)
        (exit)
    )
    (setq ang1 (angle po pb))
    (setq pn1 (polar po (+ ang1 (/ pi 2)) dist))
    (setq pn2 (polar po (- ang1 (/ pi 2)) dist))
    (setq pb1 (polar pb (+ ang1 (/ pi 2)) dist))
    (setq pb2 (polar pb (- ang1 (/ pi 2)) dist))
    (setq pe1 (inters pt1 po1 pn1 pb1 nil))
    (setq pe2 (inters pt2 po2 pn2 pb2 nil))
    (setq ent (ssget po1))
    (command "erase" ent "")
    (setvar "osmode" 0)
    (command "pline" pt1 pe1 "" "pline" pt2 pe2 "")
    (command "pline" pe1 pb1 "" "pline" pe2 pb2 "")
    (setq po  pb
          pt1 pe1
          pt2
          pe2
          po1
          pb1
          po2
          pb2
    )
    )
    (command "cmdecho" 1)
)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值