明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1698|回复: 2

[基础] cad 坐标标注

[复制链接]
发表于 2009-11-5 20:11:00 | 显示全部楼层 |阅读模式
我是新手,请问各位大侠帮忙给我写个坐标标注的可以吗?
发表于 2009-11-5 22:08:00 | 显示全部楼层

转载别人的不要盲目崇拜我

(defun c:zbbz()
(setq os (getvar "osmode"))
(while (equal h nil)
  (setq h (getreal "\n 请输入字体高度:"))
;;;  (setq a1 (getreal "\n 请输入字体角度:"))
;;;(lisp16)
(command "LAYER" "Make" "gaobz" "")
 )  
(setvar "osmode" 32)
(setq p0 (getpoint "\n 请选择插入点:"))
;;;(setq p0 (cdr (entsel (ssget "x" ax))))
(setq pxx (car p0))
(setq pyy (nth 1 p0))
(setq px (rtos pxx 2 3))
(setq py (rtos pyy 2 3))
(setvar "osmode" 0)
(setq pp (getpoint "\n 请输入第一点坐标:"))
(setq ppp (getpoint "\n 请输入第二点坐标:"))
(setq a1 (angle pp ppp))
(setq bb (/ 180 pi))
(setq b1 (/ pi 2))
(setq aa (* bb a1))
(setq h1 (* 0.5 h))
(setq h2 (* 1.5 h))
(setq h3 (* 12 h))
;;;(setq wth (assoc 41 (tblsearch "style" (getvar "textstyle"))))
(setq p1 (polar pp (+ b1 a1) h1))
(setq p2 (polar pp (- a1 b1) h2))
(setq p1 (polar p1 a1 h))
(setq p2 (polar p2 a1 h))
(setq p1x "X=")
(setq p1y "Y=")
(command "text" p1 h aa p1x)
(command "text" p2 h aa p1y)
(setq p1 (polar p1 a1 (* 2.0 h)))
(setq p2 (polar p2 a1 (* 2.0 h)))
(command "text" p1 h aa py)
(command "text" p2 h aa px)
(setq pp1 (polar pp a1 h3))
(setq dist1 (distance p0 pp))
(setq dist2 (distance p0 pp1))
(if (> dist1 dist2)
   (command "line" pp pp1 p0 nill)
   (command "line" p0 pp pp1  nill))
(setvar "osmode" os)
(princ)
)
;(defun lisp16 (/ ent entlist ax)
;(prompt "\nPick an entity on the targer layer:" )
;(setq ent (entsel))
;(setq entlist (entget (car ent)))
;(setq ax (car (assoc 8 entlist)))
;)

 楼主| 发表于 2009-11-5 23:51:00 | 显示全部楼层

2楼的大哥,我不崇拜你,我要谢谢你,今天才刚刚注册,问了个问题,就马上又好心人回答了,真的谢谢,希望MJTD越办越好

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

本版积分规则

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

GMT+8, 2024-11-6 09:28 , Processed in 0.174174 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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