代码改变世界

这是一个错误的程序

  精诚所至 金石为开  阅读(418)  评论(0编辑  收藏  举报

(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)
)

编辑推荐:
· 智能桌面机器人:用.NET IoT库控制舵机并多方法播放表情
· Linux glibc自带哈希表的用例及性能测试
· 深入理解 Mybatis 分库分表执行原理
· 如何打造一个高并发系统?
· .NET Core GC压缩(compact_phase)底层原理浅谈
阅读排行:
· 新年开篇:在本地部署DeepSeek大模型实现联网增强的AI应用
· DeepSeek火爆全网,官网宕机?本地部署一个随便玩「LLM探索」
· Janus Pro:DeepSeek 开源革新,多模态 AI 的未来
· 上周热点回顾(1.20-1.26)
· 【译】.NET 升级助手现在支持升级到集中式包管理
点击右上角即可分享
微信分享提示