明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1359|回复: 2

大虾们,这个程序怎么写!

[复制链接]
发表于 2003-10-29 12:39:00 | 显示全部楼层 |阅读模式
这条封闭多段线如何才能画出来?
请参看HELP.DWG
  1. 程序代码内容
复制代码
(setq ag 0);;;原始角
(setq WE (+ ag pi));;;西
(setq NO (+ ag (/ pi 2)));;;北
(setq SO (+ WE (/ pi 2)));;;南
(SETQ EA AG);;;东
(SETQ WN (+ AG (* PI 0.75)));;;西北
(SETQ EN (+ AG (* PI 0.25)));;;东北
(SETQ WS (+ AG (* PI 1.25)));;;西南
(SETQ ES (+ AG (* PI 1.75)));;;南

(defun draw_cir_odd(num h)
  (setq laya(+ 1 laya))
  (setq p10 (polar p0 no h))
  (command "circle" p10 hrgri)
  (repeat (/ num 2)
    (setq p10 (polar p10 0 s))
    (command "circle" p10 hrgri)
    (if (= laya 1)
      (setq pp1 p10)
      )
    (if (= laya lays)
      (setq pp2 p10)
      )
    )
  (setq p10 (polar p0 no h))
  (repeat (/ num 2)
    (setq p10 (polar p10 pi s))
    (command "circle" p10 hrgri)
    (if (= laya 1)
      (setq pp4 p10)
      )
    (if (= laya lays)
      
      (setq pp3 p10)
      )
    )
  )
(defun draw_cir_even(num h)
  (setq laya(+ 1 laya))
  (setq p10 (polar p0 no h))
  (setq p10 (polar p10 pi (/ s 2.0)))
  (repeat (/ num 2)
    (setq p10 (polar p10 0 s))
    (command "circle" p10 hrgri)
    (if (= laya 1)
      (setq pp1 p10)
      )
    (if (= laya lays)
      (setq pp2 p10)
      )
    )
  (setq p10 (polar p0 no h))
  (setq p10 (polar p10 0 (/ s 2.0)))
  (repeat (/ num 2)
    (setq p10 (polar p10 pi s))
    (command "circle" p10 hrgri)
    (if (= laya 1)
      (setq pp4 p10)
      )
    (if (= laya lays)
      (setq pp3 p10)
      )
    )
  )

本帖子中包含更多资源

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

x
"觉得好,就打赏"
还没有人打赏,支持一下
 楼主| 发表于 2003-11-2 12:09:00 | 显示全部楼层
我是个新手
请大家帮帮忙
发表于 2003-11-3 07:56:00 | 显示全部楼层
先把你的程序中未知的變數弄好再說!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-10-2 12:32 , Processed in 0.189597 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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