明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2196|回复: 2

坐标标注LISP程序修改.

[复制链接]
发表于 2007-4-4 09:00:00 | 显示全部楼层 |阅读模式

SOS:

坐标标注LISP程序修改.

思路如下:

按画好的线-->生成指定位置坐标标注值.

现有点坐标标注程序,麻烦各位高手帮帮忙,修改此程序,让其按画好的线生成指定位置坐标标注,谢谢!

 

本帖子中包含更多资源

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

x
发表于 2007-4-4 10:29:00 | 显示全部楼层
(defun c:zbb( / zg wid pt x y xx yy lken width pt2 pp2);
 (setq zg (getreal"\n字高<3.0>:"))
 (if (not zg) (setq zg 3.0))
 (command "_layer" "m" "坐标标注" "")
 (setvar "cecolor" "7")
 (setvar "clayer" "坐标标注")
 (setvar "dimzin" 0)
 (initget (+ 1 2) " ")
 ;(command "style" "k2" "Rs" "" "" "" "" "" "")
 (setvar "osmode" 33)
 (setq wid (cdr (assoc 41 (tblsearch "style" (getvar "TEXTSTYLE")))))
 (setq pt (getpoint "\n中心点:"))
 (while (listp pt)
    (setq x (rtos (car pt) 2 3))
    (setq y (rtos (cadr pt) 2 3))
    (setq xx (strcat "Y=" x))
    (setq yy (strcat "X=" y))
    (setq lken (strlen xx) width (* wid lken zg 0.75))
    (setvar "osmode" 0)
    (command "pline" pt )
    (setq pt2 (getpoint "\n方向点:" pt))
    (setq pp2 (polar pt2 (if (>= (car pt2) (car pt)) 0 pi) width))
    (command pt2)
    (command pp2 "")
    (setvar "osmode" 0)
    (command "text" (polar (if (>= (car pt2) (car pt)) pt2 (polar pt2 pi width)) (* pi 0.5) (/ zg 4)) zg 0 yy)
    (command "text" (polar (if (>= (car pt2) (car pt)) pt2 (polar pt2 pi width)) (* pi 1.5) (/ zg 0.8)) zg 0 xx)
   
    (setvar "osmode" 33)
   (initget (+ 1 2) " ")
    (setq pt (getpoint "\n下一中心点:"))
 )
(princ)
)
发表于 2014-1-15 11:44:29 | 显示全部楼层
学习学习
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-25 18:41 , Processed in 0.183402 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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