乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 22|回复: 1

求助关于Rectangle命令不能正常执行

[复制链接]

1

主题

1

帖子

1

银币

初来乍到

Rank: 1

铜币
5
发表于 2003-12-17 15:31:00 | 显示全部楼层 |阅读模式
自从试装了CAD2002后,rectangle就有问题。尤其在输入的点为0.xx时,总是显示成一条直线,莫名其妙。更可恨,这几天再试Lisp时编的一段小程序在别人的机子上正常,在我这儿就不正常,比如让它显示40个列,只显示10个!求各位大侠指点迷津,不胜感激。
(我把别人的程序拷过来覆盖了CAD目录下所有文件,还是不行。现在换成CAD2000也还是不正常)
(defun niu_draw_dots()
  (setq LeftDown (getpoint "请指定开始点!"))
  (setq width (getreal "请输入点的宽度"))
  (setq height (getreal "请输入点的高度"))
  (setq WidthPitch (getreal "请输入点的宽度Pitch"))
  (setq HeightPitch (getreal "请输入点的高度Pitch"))
  (setq ColNum (getint "请输入列数目"))
  (setq RowNum (getint "请输入行数目"))
  (setq strRightTop (strcat "@+" (rtos width 2 3) ",+" (rtos height 2 3)))
    ;转换为小数格式,精度3位
  (setq x (car LeftDown)) ;起始x
  (setq y (car (cdr LeftDown))) ;起始y
    ;指定对角点
  (setq RepeatTimes ColNum);开始画最底行
  (repeat repeattimes
    (command "rectangle" (list x y) strRightTop)
    (setq x (+ x WidthPitch))
      ;将x和y的值各增加20
   )
    ;开始画左列
  (setq RepeatTimes (- RowNum 1))
  (setq x (car LeftDown))
  (setq y (car (cdr LeftDown)))
  (setq y (+ y HeightPitch))
  (repeat repeattimes
    (command "rectangle" (list x y) strRightTop)
    (setq y (+ y HeightPitch))
  )
    ;开始画顶行
  (setq RepeatTimes (- ColNum 1))
  (setq x (car LeftDown))
  (setq y (car (cdr LeftDown)))
  (setq x (+ x WidthPitch))
  (setq y (+ y (* HeightPitch (- RowNum 1))))
    ;y=y+(RowNum-1)*HeightPitch
  (repeat repeattimes
    (command "rectangle" (list x y) strRightTop)
    (setq x (+ x WidthPitch))
  )
    ;开始画右列
  (setq RepeatTimes (- RowNum 1))
  (setq x (car LeftDown))
  (setq y (car (cdr LeftDown)))
    ;x=x+(ColNum-1)*WidthPitch
  (setq x (+ x (* WidthPitch (- ColNum 1))))
  (setq y (+ y HeightPitch))
  (repeat repeattimes
    (command "rectangle" (list x y) strRightTop)
    (setq y (+ y HeightPitch))
  )
)
回复

使用道具 举报

26

主题

3072

帖子

10

银币

社区元老

Rank: 75Rank: 75Rank: 75

铜币
3177
发表于 2003-12-18 12:47:00 | 显示全部楼层
程序开头加上(setvar "osmode" 0)再试试
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-7 18:34 , Processed in 0.881182 second(s), 56 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表