找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 697|回复: 3

[编程申请]:请大家帮我看看

[复制链接]
发表于 2005-11-22 10:45:00 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

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

×
大家帮我看看,为什么我输入3.000后输出为3,
大家有高手的帮我改改。
还有文字,我想把它弄到pipi_文字层上,也帮我改改,谢谢了
******************标高1
(defun C:bg1(/ dx dy dx1 dx2 dx3 dy1 pt dxt dyt
               lay pt1 pt2 pt3 pt4 pt5 ptt scale)
  (setvar "CMDECHO" 0)
  (setq lay (getvar "clayer"))
  (command "color" "bylayer")
  (command "layer" "m" "pipi_文字" "c" "white" "pipi_文字" "")
  (command "layer" "m" "pipi_标高" "c" "94" "pipi_标高" "")
  (if (or (= nil (tblsearch "style" "pipi_标高"))
          (/= (cdr (assoc 40 (tblsearch "style" "pipi_标高"))) 0)
      )
    (command "STYLE" "pipi_标高" "romanc" "0" ".75" "0" "n" "n" "n")
  )
  (if (= scab nil) (setq scab 1.0))
  (setq scale (getreal (strcat "\nScale <" (rtos scab 2 0) ">:")))
    (if (= scale nil) (setq scale scab))
    (setq scab scale)
  (setvar "osmode" 512)
  (setq pt (getpoint "\nInsert point <nea mode>: "))
  (setvar "osmode" 0)
    (setq dy (cadr pt))
    (setq dx (car pt))
      (setq dx1 (- dx (* 3 scale)))
      (setq dx2 (+ dx (* 3 scale)))
      (setq pt1 (list dx1 dy))
      (setq pt2 (list dx2 dy))
        (command "line" pt1 pt2 "")  
      (setq dy1 (+ dy (* 3 scale)))
      (setq pt3 (list dx1 dy1))
        (command "line" pt pt3 "")  
      (setq pt4 (list dx2 dy1))
        (command "line" pt pt4 "")  
      (setq dx3 (+ dx (* 13 scale)))
      (setq pt5 (list dx3 dy1))
        (command "line" pt3 pt5 "")  
      (setq dxt dx2)
      (setq dyt (+ dy1 (* 1.15 scale)))
      (setq txt 0)
      (setq high (* 3 scale))
      (while (/= txt nil)
        (setq txt (getreal "\nText:"))  
          (if (/= txt nil)
            (progn
              (setq ptt (list dxt dyt))
              (setq txt1 (rtos txt 2 3))
              (command "text" "s" "pipi_标高" ptt high "0" txt1)
              (setq dyt (+ dyt (* 4.15 scale)))
            )
          )
      )
  (command "layer" "s" lay "")
  (princ)(princ)
)
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 8157个

财富等级: 富甲天下

发表于 2005-11-22 11:10:09 | 显示全部楼层
(setvar "textstyle" "pipi_标高")
(while  (/=  (setq txt (getstring "\nText:")) "")
       (setq ptt (list dxt dyt))
      ;(setq txt1 (rtos txt 2 3))
      ;(command "text" "s" "pipi_标高" ptt high "0" txt1)
      (command "text"  ptt high "0" txt)
      (command "chprop" (entlast) "" "LA" "pipi_文字" "")
      (setq dyt (+ dyt (* 4.15 scale)))
)
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2005-11-22 14:57:21 | 显示全部楼层

Re: [编程申请]:请大家帮我看看

最初由 pipi002004 发布
[B]大家帮我看看,为什么我输入3.000后输出为3,
大家有高手的帮我改改。
还有文字,我想把它弄到pipi_文字层上,也帮我改改,谢谢了
******************标高1
(defun C:bg1(/ dx dy dx1 dx2 dx3 dy1 pt dxt dyt
... [/B]
  1. [FONT=courier new]
  2. ;;;******************标高1
  3. (defun C:bg1 (/        dx dy dx1 dx2 dx3 dy1 pt dxt dyt lay pt1 pt2 pt3 pt4 pt5
  4.               ptt scale)
  5.   (setvar "CMDECHO" 0)
  6.   (setvar "DIMZIN" 0)                        ;保留后续零
  7.   (setq lay (getvar "clayer"))
  8.   (command "color" "bylayer")
  9.   (command "layer" "m" "pipi_标高" "c" "94" "" "")
  10.   (if (or (= nil (tblsearch "style" "pipi_标高"))
  11.           (/= (cdr (assoc 40 (tblsearch "style" "pipi_标高"))) 0)
  12.       )
  13.     (command "STYLE" "pipi_标高" "romanc" "0" "0.75" "0" "n" "n" "n")
  14.   )
  15.   (if (= scab nil)
  16.     (setq scab 1.0)
  17.   )
  18.   (setq scale (getreal (strcat "\nScale <" (rtos scab 2 0) ">:")))
  19.   (if (= scale nil)
  20.     (setq scale scab)
  21.   )
  22.   (setq scab scale)
  23.   (setvar "osmode" 512)
  24.   (setq pt (getpoint "\nInsert point : "))
  25.   (setvar "osmode" 0)
  26.   (setq        dy  (cadr pt)
  27.         dx  (car pt)
  28.         dx1 (- dx (* 3 scale))
  29.         dx2 (+ dx (* 3 scale))
  30.         pt1 (list dx1 dy)
  31.         pt2 (list dx2 dy)
  32.   )
  33.   (command "line" pt1 pt2 "")
  34.   (setq        dy1 (+ dy (* 3 scale))
  35.         pt3 (list dx1 dy1)
  36.   )
  37.   (command "line" pt pt3 "")
  38.   (setq pt4 (list dx2 dy1))
  39.   (command "line" pt pt4 "")
  40.   (setq        dx3 (+ dx (* 13 scale))
  41.         pt5 (list dx3 dy1)
  42.   )
  43.   (command "line" pt3 pt5 "")
  44.   (setq        dxt  dx2
  45.         dyt  (+ dy1 (* 1.15 scale))
  46.         txt  0
  47.         high (* 3 scale)
  48.   )
  49.   (while (/= txt nil)
  50.     (setq txt (getreal "\nText:"))
  51.     (if        (/= txt nil)
  52.       (progn
  53.         (setq ptt  (list dxt dyt)
  54.               txt1 (rtos txt 2 3)
  55.         )
  56.         (command "layer" "m" "pipi_文字" "c" "white" "" "")
  57.         (command "text" "s" "pipi_标高" ptt high "0" txt1)
  58.         (setq dyt (+ dyt (* 4.15 scale)))
  59.       )
  60.     )
  61.   )
  62.   (command "layer" "s" lay "")
  63.   (princ)
  64. )[/FONT]

可以试试“立剖面标高程序”:http://www.xdcad.net/forum/showthread.php?s=&threadid=291466
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-11-22 21:27:39 | 显示全部楼层
真的谢谢大家,经过测试xyp1964大哥的代码在r14+XP系统下完美无暇,正是我想要的效果,谢谢了,欢迎大家下载,希望下载的朋友都来支持这些朋友门,有问题就提,他们真的很好!!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-9-28 22:10 , Processed in 0.244414 second(s), 38 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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